title: javamail isSSL false even though I've set tls to True when sending mail
body: <p>I'm trying to use javamail to send out an email. It worked in a java application. But i got some errors when i use it in my Weblogic web application.</p>
  
  <pre><code>Properties props = new Properties();
  props.setProperty("mail.transport.protocol", "SMTPS");
  props.setProperty("mail.smtp.host", "msg.petrochina.com.cn");
  props.setProperty("mail.smtp.port", "465");
  props.setProperty("mail.smtp.auth", "true");
  MailSSLSocketFactory sf = null;
  try {
    sf = new MailSSLSocketFactory();
    sf.setTrustAllHosts(true);
  } catch (GeneralSecurityException e1) {
    e1.printStackTrace();
  }
  props.put("mail.smtp.ssl.enable", "true");
  props.put("mail.smtp.starttls.enable","true");
  props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
  props.put("mail.smtp.socketFactory.port", "465");
  props.put("mail.smtp.socketFactory.fallback", "false");
  props.put("mail.smtp.ssl.socketFactory", sf);
  final Authenticator authenticator = new Authenticator() {
  protected PasswordAuthentication getPasswordAuthentication() {
      return new PasswordAuthentication("dqlhgysbj@petrochina.com.cn", "123456");
  }
  };
  
  Session session = Session.getDefaultInstance(props, authenticator);
  session.setDebug(true);
  MimeMessage mimeMessage = new MimeMessage(session);
    mimeMessage.setFrom(new InternetAddress("dqlhgysbj@petrochina.com.cn","dqlhgys"));
    mimeMessage.addRecipient(Message.RecipientType.TO, new InternetAddress("dqlhgysaccept@petrochina.com"));
    mimeMessage.setSubject("test");
    mimeMessage.setSentDate(new Date());
    mimeMessage.setText("testMailContent","utf-8");
    mimeMessage.saveChanges();
    Transport.send(mimeMessage);
  </code></pre>
  
  <p>When i run the app I can see the following in my log</p>
  
  <pre><code>DEBUG: set            
  DEBUG: JavaMail version 1.4.1
  DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
  DEBUG SMTP: useEhlo true, useAuth true
  DEBUG SMTP: useEhlo true, useAuth true
  DEBUG SMTP: trying to connect to host "msg.petrochina.com.cn", port 465, isSSL false
  220 petrochina.com.cn [20137] ESMTP MTA v8.1.2; Mon, 03 Dec 2018 15:59:04 +0800
  DEBUG SMTP: connected to host "msg.petrochina.com.cn", port: 465
  EHLO SUNWAY-DEV3
  250-petrochina.com.cn
  250-SIZE 104857600
  250-AUTH=LOGIN PLAIN
  250-AUTH LOGIN PLAIN
  250-STARTTLS
  250 8BITMIME
  DEBUG SMTP: Found extension "SIZE", arg "104857600"
  DEBUG SMTP: Found extension "AUTH=LOGIN", arg "PLAIN"
  DEBUG SMTP: Found extension "AUTH", arg "LOGIN PLAIN"
  DEBUG SMTP: Found extension "STARTTLS", arg ""
  DEBUG SMTP: Found extension "8BITMIME", arg ""
  STARTTLS
  454 tls initialize failed: ssl accept error. (#4.7.0) (eYou MTA)
      javax.mail.MessagingException: 454 tls initialize failed: ssl accept error. (#4.7.0) (eYou MTA)
  </code></pre>
  
  <p>It seems the application is trying to connect without ssl, and it won't connect.But i can connect the address with telnet.<a href="https://i.stack.imgur.com/XNJgy.png" rel="nofollow noreferrer">telnet</a></p>