LoginSignup
4
3

More than 3 years have passed since last update.

Win10 + Zscaler + Android Studio(Flutter)

Last updated at Posted at 2020-05-26

はじめに

テレワークをするために、「Zscaler」なるクラウドセキュリティを導入することになった。
この「Zscaler」の証明書問題が原因でAndroid Studioでの環境構築が止まってしまった。
調査にかなり時間がかかったので、実行手順をまとめていきます。

実行手順

Zscalerの証明書をDLする

Chrome(ブラウザ)からZscalerの証明書をエクスポートしてくる(.cer形式)
(↑がリンクになっているので、やり方が分からなければ見てください。)

コマンドプロンプト上でコマンドをたたく

openssl x509 -inform der -in certificate.cer -out certificate.pem

権限が足りなければ、管理者で実行後にたたく

環境変数に生成したpemファイルを以下に追加する

変数名:DART_VM_OPTIONS
変数値:--root-certs-file=[path_to_pem_file]

Android Studioに証明書を追加する

Android Studio>Setting>Tools>Server Certification
ここに.cerの証明書を追加する

再起動後、Android Studioの設定とAndroid Studioが見ているjavaに証明書を追加する
以下のコマンドをWindows Power Shell管理者権限で実行して、たたく
*keytoolはAndroidStudioのjavaの中にあるので、その中まで入る必要があります。

PS C:\Program Files\Android\Android Studio\jre\bin> .\keytool.exe -import -alias Zscaler  -file 'C:\Users\*******\Downloads\zscaler.cer'  -keystore "C:\Program Files\Android\Android Studio\jre\jre\lib\security\cacerts"

PassWord: changeit

これができたら、最後に以下を実行

Setting>Invalidate Caches/Restart

ダメだった場合は、再起動して完成。

ちなみに

git cloneをしようとして、SSLエラーが出た場合は以下のコマンドを実行すると解決するかも

git config --global http.sslVerify false

おわりに

今回参考にしたリンクを張っていくので、この対処が使えなくなったときは以下のリンクまで行って探してほしい。

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3