3

Windows で実行されている Jenkins で STARTTLS を有効にするにはどうすればよいですか?

Windows 2008 サーバーで Jenkins を実行しており、電子メール通知は次の情報で構成されています。

  • ホスト: smtp.office365.com
  • ポート: 587
  • SMTP 認証: 真
  • SSL: 真
  • 等...

テストを実行すると、次の例外メッセージが表示されます。

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?

この問題は、接続セキュリティにSTARTTLSを使用しているsmtp.office365.comが原因のようです。次の引数を追加して、 jenkins.xml構成ファイルを介してSTARTTLSを有効にしようとしました:

-Dmail.smtp.starttls.enable=true

  1. これは正しいスイッチ/パラメーターですか?
  2. jenkins.xmlは更新する正しいファイルですか?

: Linux 環境でこれを解決した人がいることは承知していますが、Windows に固有の解決策を探しています。以下は、現在の jenkins.xml ファイルのスニペットです。

<service>
  <id>jenkins</id>
  <name>Jenkins</name>
  <description>This service runs Jenkins continuous integration system.</description>
  <env name="JENKINS_HOME" value="%BASE%"/>

  <!--
    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.
  -->
  <executable>%BASE%\jre\bin\java</executable>
  <arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=8080 -Dmail.smtp.starttls.enable=true</arguments>
  <!--
    interactive flag causes the empty black Java window to be displayed.
    I'm still debugging this.
  <interactive />
  -->
  <logmode>rotate</logmode>

  <onfailure action="restart" />
</service>
4

1 に答える 1

0

引数の順序は重要だと思います。-Dmail.smtp.starttls.enable=true を -jar 引数の前に置く必要がありました。

-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -Dmail.smtp.starttls.enable=true -jar "%BASE%\jenkins.war" --httpPort=8080

于 2014-02-03T12:12:05.517 に答える