1 | int sslType = item.getIntegerWithDefault("ssl_type", ↵ | | 1 | int sslType = popItem.getIntegerWithDefault("ssl_type",↵
|
2 | IncomingItem.TLS);↵ | | 2 | IncomingItem.TLS);↵
|
3 | boolean sslEnabled = item.getBoolean("enable_ssl");↵ | | 3 | boolean sslEnabled = popItem.getBoolean("enable_ssl");↵
|
|
4 | // open a port to the server↵ | | 4 | // open a port to the server↵
|
5 | if (sslEnabled && sslType == IncomingItem.IMAPS_POP3S) {↵ | | 5 | if (sslEnabled && sslType == IncomingItem.IMAPS_POP3S) {↵
|
6 | try {↵ | | 6 | try {↵
|
7 | protocol.openSSLPort();↵ | | 7 | protocol.openSSLPort();↵
|
8 | usingSSL = true;↵ | | 8 | usingSSL = true;↵
|
9 | } catch (SSLException e) {↵ | | 9 | } catch (SSLException e) {↵
|
10 | int result = showErrorDialog(MailResourceLoader.getString(↵ | | 10 | int result = showErrorDialog(MailResourceLoader.getString(↵
|
11 | "dialog", "error", "ssl_handshake_error")↵ | | 11 | "dialog", "error", "ssl_handshake_error")↵
|
12 | + ": "↵ | | 12 | + ": "↵
|
13 | + e.getLocalizedMessage()↵ | | 13 | + e.getLocalizedMessage()↵
|
14 | + "\n"↵ | | 14 | + "\n"↵
|
15 | + MailResourceLoader.getString("dialog", "error",↵ | | 15 | + MailResourceLoader.getString("dialog", "error",↵
|
16 | "ssl_turn_off"));↵ | | 16 | "ssl_turn_off"));↵
|
|
17 | if (result == 1) {↵ | | 17 | if (result == JOptionPane.CANCEL_OPTION) {↵
|
18 | throw new CommandCancelledException();↵ | | 18 | throw new CommandCancelledException();↵
|
19 | }↵ | | 19 | }↵
|
|
20 | // turn off SSL for the future↵ | | 20 | // turn off SSL for the future↵
|
21 | item.setBoolean("enable_ssl", false);↵ | | 21 | popItem.setBoolean("enable_ssl", false);↵
|
22 | item.setInteger("port", IMAPProtocol.DEFAULT_PORT);↵ | | 22 | popItem.setInteger("port", POP3Protocol.DEFAULT_PORT);↵
|
|
23 | // reopen the port↵ | | 23 | // reopen the port↵
|
24 | protocol.openPort();↵ | | 24 | protocol.openPort();↵
|
25 | }↵ | | 25 | }↵
|
26 | } else {↵ | | 26 | } else {↵
|
27 | protocol.openPort();↵ | | 27 | protocol.openPort();↵
|
28 | } | | 28 | }
|