Skip to content

Instantly share code, notes, and snippets.

@tkawachi
Last active November 4, 2015 11:11
Show Gist options
  • Save tkawachi/cd6141ab53f96d1d681b to your computer and use it in GitHub Desktop.
Save tkawachi/cd6141ab53f96d1d681b to your computer and use it in GitHub Desktop.

sbt の通信を見てみよう

sbt の通信、遅いですよね。 オーストラリアからは特に遅いらしく help the Australian problem と呼ばれてるみたいです。 https://twitter.com/eed3si9n_ja/status/652546775316885504

Man in the middle しよう

通信を覗きたいのですが、https での通信は tcpdump しただけでは読めません。 というわけで、間に proxy を入れて man in the middle やります。

これを:
sbt <---------------> server
          https
こうする:
sbt <---> proxy <---> server
    https       https

私は Mac を使っていたので Charles というソフトウェア($50/license)で試しました。30日試用できます。

https://www.charlesproxy.com/documentation/using-charles/ssl-certificates/ の JAVA APPLICATIONS のところを参照して keytool コマンドを使って cacerts ファイルに Charles の証明書を追加します。 元のものを直接編集するのは気持ち悪いので JRE の下からコピーして作業するのをお勧めします。

sbt 起動するときに次のオプションを指定します。

  • 作った cacerts ファイルを使う -Djavax.net.ssl.trustStore=/path/to/cacerts
  • Proxy の場所を指定する -DproxySet=true -DproxyHost=127.0.0.1 -DproxyPort=8888

それで通信すると

改善できそうな点

sbt の通信が遅い原因はわかりましたね。

http://togetter.com/li/884631 sbt/sbt#2189

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment