@numa08 猫耳帽子の女の子

明日目が覚めたら俺達の業界が夢のような世界になっているとイイナ。

XcodeのBotでhttpsなSubversionをチェックアウトする

Xcode5からBotが導入され、継続的インテグレーションを行うことが割りと簡単に行えるようになりました。

VCSを定期的に監視し、変更を取得してテストやビルドを行うサイクルを作り出すことができます。しかし、Subversionを利用している場合プロトコルhttpsの場合、次の様なメッセージとエラーが表示されることがあります。

$ svn info https://subversion.server.host/svn/repository/

Error validating server certificate for 'https://subversion.server.host:443':
 - The certificate is not issued by a trusted authority. Use the
   fingerprint to validate the certificate manually!
Certificate information:
 - Hostname: *.server.host
 - Valid: from Wed, 12 Jun 2013 15:09:49 GMT until Sun, 15 Jun 2014 08:07:16 GMT
 - Issuer: Issuer, Inc., US
 - Fingerprint: ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
(R)eject, accept (t)emporarily or accept (p)ermanently? 
svn: E175002: Unable to connect to a repository at URL 'https://subversion.server.host/svn/repository'
svn: E175002: OPTIONS of 'https://subversion.server.host/svn/repository': Server certificate verification failed: issuer is not trusted (https://subversion.server.host)

証明書が見つからないため、接続先ホストを信用するかどうかを対話的に問い合わせてきます。この際、通常のSubversionXcodeであれば適切な入力を行うことで、作業を続けることが可能です。

が、Botを利用している場合はその限りではありません。なぜなら対話的に問い合わされても返答ができないから。よって、ソースコードの取得に失敗し、結果インテグレーションに失敗します。

そこで、次のように設定ファイルを編集することでとりあえず対応可能です。

/Library/Server/Xcode/Config/xcsbuildd.plist

    <key>TrustSelfSignedSSLCertificates</key>
-  <false/>
+   <true/>

あくまでもとりあえずの対応で、信頼できるサーバに接続する場合のみに限定するべきかと思われます。

ケースバイケースで適切に判断をしてご利用ください。