|
|
@ -454,7 +454,9 @@ public class EmailService implements AutoCloseable {
|
|
|
|
boolean bc = prefs.getBoolean("bouncy_castle", false);
|
|
|
|
boolean bc = prefs.getBoolean("bouncy_castle", false);
|
|
|
|
boolean fips = prefs.getBoolean("bc_fips", false);
|
|
|
|
boolean fips = prefs.getBoolean("bc_fips", false);
|
|
|
|
factory = new SSLSocketFactoryService(
|
|
|
|
factory = new SSLSocketFactoryService(
|
|
|
|
host, insecure, ssl_harden, strict, cert_strict, cert_transparency, check_names, bc, fips, key, chain, fingerprint);
|
|
|
|
context, host, insecure,
|
|
|
|
|
|
|
|
ssl_harden, strict, cert_strict, cert_transparency, check_names,
|
|
|
|
|
|
|
|
bc, fips, key, chain, fingerprint);
|
|
|
|
properties.put("mail." + protocol + ".ssl.socketFactory", factory);
|
|
|
|
properties.put("mail." + protocol + ".ssl.socketFactory", factory);
|
|
|
|
properties.put("mail." + protocol + ".socketFactory.fallback", "false");
|
|
|
|
properties.put("mail." + protocol + ".socketFactory.fallback", "false");
|
|
|
|
properties.put("mail." + protocol + ".ssl.checkserveridentity", "false");
|
|
|
|
properties.put("mail." + protocol + ".ssl.checkserveridentity", "false");
|
|
|
@ -1040,7 +1042,7 @@ public class EmailService implements AutoCloseable {
|
|
|
|
private SSLSocketFactory factory;
|
|
|
|
private SSLSocketFactory factory;
|
|
|
|
private X509Certificate certificate;
|
|
|
|
private X509Certificate certificate;
|
|
|
|
|
|
|
|
|
|
|
|
SSLSocketFactoryService(String host, boolean insecure,
|
|
|
|
SSLSocketFactoryService(Context context, String host, boolean insecure,
|
|
|
|
boolean ssl_harden, boolean ssl_harden_strict, boolean cert_strict, boolean cert_transparency, boolean check_names,
|
|
|
|
boolean ssl_harden, boolean ssl_harden_strict, boolean cert_strict, boolean cert_transparency, boolean check_names,
|
|
|
|
boolean bc, boolean fips,
|
|
|
|
boolean bc, boolean fips,
|
|
|
|
PrivateKey key, X509Certificate[] chain, String fingerprint) throws GeneralSecurityException {
|
|
|
|
PrivateKey key, X509Certificate[] chain, String fingerprint) throws GeneralSecurityException {
|
|
|
@ -1050,7 +1052,8 @@ public class EmailService implements AutoCloseable {
|
|
|
|
this.ssl_harden_strict = ssl_harden_strict;
|
|
|
|
this.ssl_harden_strict = ssl_harden_strict;
|
|
|
|
this.trustedFingerprint = fingerprint;
|
|
|
|
this.trustedFingerprint = fingerprint;
|
|
|
|
|
|
|
|
|
|
|
|
TrustManager[] tms = SSLHelper.getTrustManagers(server, secure, cert_strict, cert_transparency, check_names, trustedFingerprint,
|
|
|
|
TrustManager[] tms = SSLHelper.getTrustManagers(
|
|
|
|
|
|
|
|
context, server, secure, cert_strict, cert_transparency, check_names, trustedFingerprint,
|
|
|
|
new SSLHelper.ITrust() {
|
|
|
|
new SSLHelper.ITrust() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void checkServerTrusted(X509Certificate[] chain) {
|
|
|
|
public void checkServerTrusted(X509Certificate[] chain) {
|
|
|
|