0

I check with SSLContext.getDefault()

SSLContext.getDefault().protocol shows me Default

SSLContext.getDefault().provider shows

"Alg.Alias.Signature.OID.1.3.14.3.2.29" -> "SHA1withRSA"
"KeyManagerFactory.NewSunX509" -> "sun.security.ssl.KeyManagerFactoryImpl$X509"
"Alg.Alias.TrustManagerFactory.X.509" -> "PKIX"
"Alg.Alias.SSLContext.SSL" -> "TLS"
"Alg.Alias.SSLContext.SSLv3" -> "TLSv1"
"Provider.id version" -> "11"
"SSLContext.DTLS" -> "sun.security.ssl.SSLContextImpl$DTLSContext"
"Alg.Alias.KeyPairGenerator.1.2.840.113549.1.1" -> "RSA"
"SSLContext.TLS" -> "sun.security.ssl.SSLContextImpl$TLSContext"
"Provider.id info" -> "Sun JSSE provider(PKCS12, SunX509/PKIX key/trust factories, SSLv3/TLSv1/TLSv1.1/TLSv1.2/TLSv1.3/DTLSv1.0/DTLSv1.2)"
"Alg.Alias.TrustManagerFactory.SunPKIX" -> "PKIX"
"SSLContext.TLSv1" -> "sun.security.ssl.SSLContextImpl$TLS10Context"
"KeyPairGenerator.RSA" -> "sun.security.rsa.RSAKeyPairGenerator$Legacy"
"Provider.id className" -> "com.sun.net.ssl.internal.ssl.Provider"
"Alg.Alias.Signature.1.2.840.113549.1.1.2" -> "MD2withRSA"
"Signature.MD5andSHA1withRSA" -> "sun.security.ssl.RSASignature"
"SSLContext.DTLSv1.0" -> "sun.security.ssl.SSLContextImpl$DTLS10Context"
"Alg.Alias.KeyPairGenerator.OID.1.2.840.113549.1.1" -> "RSA"
"Alg.Alias.Signature.1.2.840.113549.1.1.5" -> "SHA1withRSA"
"Alg.Alias.Signature.1.2.840.113549.1.1.4" -> "MD5withRSA"
"Signature.SHA1withRSA" -> "sun.security.rsa.RSASignature$SHA1withRSA"
"Alg.Alias.Signature.OID.1.2.840.113549.1.1.2" -> "MD2withRSA"
"TrustManagerFactory.PKIX" -> "sun.security.ssl.TrustManagerFactoryImpl$PKIXFactory"
"Alg.Alias.Signature.1.3.14.3.2.29" -> "SHA1withRSA"
"SSLContext.TLSv1.3" -> "sun.security.ssl.SSLContextImpl$TLS13Context"
"KeyStore.PKCS12" -> "sun.security.pkcs12.PKCS12KeyStore"
"Alg.Alias.KeyFactory.OID.1.2.840.113549.1.1" -> "RSA"
"SSLContext.DTLSv1.2" -> "sun.security.ssl.SSLContextImpl$DTLS12Context"
"KeyFactory.RSA" -> "sun.security.rsa.RSAKeyFactory$Legacy"
"KeyManagerFactory.SunX509" -> "sun.security.ssl.KeyManagerFactoryImpl$SunX509"
"SSLContext.Default" -> "sun.security.ssl.SSLContextImpl$DefaultSSLContext"
"Alg.Alias.TrustManagerFactory.X509" -> "PKIX"
"Provider.id name" -> "SunJSSE"
"TrustManagerFactory.SunX509" -> "sun.security.ssl.TrustManagerFactoryImpl$SimpleFactory"
"Alg.Alias.KeyFactory.1.2.840.113549.1.1" -> "RSA"
"Signature.MD2withRSA" -> "sun.security.rsa.RSASignature$MD2withRSA"
"Alg.Alias.KeyManagerFactory.PKIX" -> "NewSunX509"
"Signature.MD5withRSA" -> "sun.security.rsa.RSASignature$MD5withRSA"
"SSLContext.TLSv1.2" -> "sun.security.ssl.SSLContextImpl$TLS12Context"
"SSLContext.TLSv1.1" -> "sun.security.ssl.SSLContextImpl$TLS11Context"
"Alg.Alias.Signature.OID.1.2.840.113549.1.1.5" -> "SHA1withRSA"
"Alg.Alias.Signature.OID.1.2.840.113549.1.1.4" -> "MD5withRSA"

But I still don't know which one is default? TLSv1.1 or TLSv1.2, or sth else?

My goal is to check the current default and based on my JDK, which is java11, I expect to see TLSv1.2

ref: Java 8 SSLContext.getInstance("TLSv1.2") what does it mean?

Holm
  • 2,987
  • 3
  • 27
  • 48
  • `SSLContext.getDefaultParameters().getProtocols()` (note this is a list and almost never a single value). The protocol actually used for a _connection_ will be negotiated and cannot be accurately predicted from either endpoint alone. – dave_thompson_085 May 22 '20 at 16:29
  • I saw some code snippet to force TLSv2, for example, https://stackoverflow.com/questions/39161542/how-to-enforce-tls1-2-to-rest-client-using-rest-template. Does Load Balancer handle the negotiation? is there any documentation to read about it? – Holm May 22 '20 at 19:26
  • There is no TLSv2, and that other Q is about _enabling_ 1.2 (because the peer requires it, as many now do) not forcing it. Generally load balances apply only to servers, and you didn't say you are implementing a server; there are thousands of kinds of load balancers, and what they do varies, and may or may not include SSL/TLS termination (including negotiation). If you have a specific question, ask it. – dave_thompson_085 May 23 '20 at 17:49

0 Answers0