2 Replies Latest reply: Mar 12, 2013 10:20 AM by 996091 RSS

    TLS 1.2 with Java Mail

      How can I enforce the communication on TLS 1.2 with Java Mail API?

      I try to set TLSv1.2 is SSLContext but the communication always takes place on TLSv1.

      Please suggest.
        • 1. Re: TLS 1.2 with Java Mail
          Bill Shannon-Oracle
          Are you setting a new default SSLContext?

          By default, JavaMail will use the default SSLSocketFactory, which (I believe) by default will use the default SSLContext.

          You can also set the property mail.<protocol>.ssl.protocols to the protocol you want to be used,
          which will be passed to the SSLSocket.setEnabledProtocols method.
          • 2. Re: TLS 1.2 with Java Mail
            Yes I am overriding the default SocketFactory.

            By setting the property mail.smtp.ssl.protocols I was able to enforce the TLSv1.2.

            Thanks a lot for the help.