Alternative to sslSocketFactory in Java10
Use sslSocketFactory(SSLSocketFactory sslSocketFactory, X509TrustManager trustManager)
In your code example you construct a X509TrustManager, just pass it in along with the socket factory.
Use sslSocketFactory(SSLSocketFactory sslSocketFactory, X509TrustManager trustManager)
In your code example you construct a X509TrustManager, just pass it in along with the socket factory.