Note that there are some explanatory texts on larger screens.

plurals
  1. POJenkins on Windows - Could not connect to SMTP host, "Unrecognized SSL message"
    text
    copied!<p>How do I enable STARTTLS for Jenkins running on Windows?</p> <p>I have Jenkins running on a Windows 2008 server, and my email notifications are configured with the following info:</p> <ul> <li>Host: smtp.office365.com</li> <li>Port: 587</li> <li>SMTP Auth: True</li> <li>SSL: True</li> <li>etc...</li> </ul> <p>When I run a test, I get the following exception message:</p> <pre><code>javax.mail.MessagingException: Could not connect to SMTP host: smtp.office365.com, port: 587; nested exception is: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection? </code></pre> <p>The issue seems to be due to <strong>smtp.office365.com</strong> using <strong>STARTTLS</strong> for the connection security. I have tried to enable <strong>STARTTLS</strong> through the <em>jenkins.xml</em> config file, by adding the following argument:</p> <p><strong>-Dmail.smtp.starttls.enable=true</strong></p> <ol> <li>Is this correct switch/parameter?</li> <li>Is <em>jenkins.xml</em> the correct file to update? </li> </ol> <p><strong>Note</strong>: I am aware, some people have solved this in their Linux environment, but I am looking for a solution that's specific to Windows. Below is a snippet of my current jenkins.xml file:</p> <pre><code>&lt;service&gt; &lt;id&gt;jenkins&lt;/id&gt; &lt;name&gt;Jenkins&lt;/name&gt; &lt;description&gt;This service runs Jenkins continuous integration system.&lt;/description&gt; &lt;env name="JENKINS_HOME" value="%BASE%"/&gt; &lt;!-- if you'd like to run Jenkins with a specific version of Java, specify a full path to java.exe. The following value assumes that you have java in your PATH. --&gt; &lt;executable&gt;%BASE%\jre\bin\java&lt;/executable&gt; &lt;arguments&gt;-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=8080 -Dmail.smtp.starttls.enable=true&lt;/arguments&gt; &lt;!-- interactive flag causes the empty black Java window to be displayed. I'm still debugging this. &lt;interactive /&gt; --&gt; &lt;logmode&gt;rotate&lt;/logmode&gt; &lt;onfailure action="restart" /&gt; &lt;/service&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload