| 54 | | * [http://biokids.org/?%A4%C9%A4%D6%A4%AA%2F%B3%AB%C8%AF%A4%B7%A4%E8%A4%A6%A1%AA%2FGit%A5%AF%A5%C3%A5%AF%A5%D6%A5%C3%A5%AF どぶお/開発しよう!/Gitクックブック - BioKids Wiki] |
| 55 | | > === GitHubにHTTPSでアクセスするとSSL証明書の検証に失敗する |
| 56 | | > この場合のように新たな証明書をOpenSSLへインストールする方法について解説したページが見つからなかったのでメモしておきます。 |
| 57 | | 1. git config --global http.sslCAPath "C:\Program Files (x86)\Git\ssl\certs" |
| 58 | | {{{ |
| 59 | | [http] |
| 60 | | sslCAPath = C:\\Program Files (x86)\\Git\\ssl\\certs |
| 61 | | }}} |
| 62 | | * 手動で追加する場合、以下のように書いてもよい |
| 63 | | {{{ |
| 64 | | [http] |
| 65 | | sslCAPath = 'C:/Program Files (x86)/Git/ssl/certs' |
| 66 | | }}} |
| 67 | | 2. 証明書の用意 |
| 68 | | * $ openssl x509 -inform der -in cacert.cer -out cacert.pem |
| 69 | | * $ mv cacert.pem `openssl x509 -hash -noout -in cacert.pem`.0 |
| 70 | | * $ ls -l |
| 71 | | {{{ |
| 72 | | total 8671524 |
| 73 | | -rw-r--r-- 1 mitty mitty 1326 Jun 8 02:47 5391e9e0.0 |
| 74 | | -rw------- 1 mitty mitty 937 Feb 19 10:08 cacert.cer |
| 75 | | }}} |
| 76 | | 3. C:\Program Files (x86)\Git\ssl\certs にコピー |
| 77 | | * うまくいかない |
| 78 | | * root証明書ではなくサーバ証明書も追加してみたがだめ |
| 79 | | * C:\Program Files (x86)\Git\bin\curl-ca-bundle.crt にBase64形式で追記する方法でもだめ |
| 80 | | * いずれも、Unknown SSL protocol error in connection to ... となる |
| 81 | | * [http://stackoverflow.com/questions/3777075/ssl-certificate-rejected-trying-to-access-github-over-https-behind-firewall git - SSL certificate rejected trying to access GitHub over HTTPS behind firewall - Stack Overflow] |
| 82 | | > {{{ |
| 83 | | > $ env GIT_SSL_NO_VERIFY=true git clone https://github... |
| 84 | | > }}} |
| 85 | | |
| | 63 | |
| | 64 | = git via https = |
| | 65 | * [http://biokids.org/?%A4%C9%A4%D6%A4%AA%2F%B3%AB%C8%AF%A4%B7%A4%E8%A4%A6%A1%AA%2FGit%A5%AF%A5%C3%A5%AF%A5%D6%A5%C3%A5%AF どぶお/開発しよう!/Gitクックブック - BioKids Wiki] |
| | 66 | > === GitHubにHTTPSでアクセスするとSSL証明書の検証に失敗する |
| | 67 | > この場合のように新たな証明書をOpenSSLへインストールする方法について解説したページが見つからなかったのでメモしておきます。 |
| | 68 | 1. git config --global http.sslCAPath "C:\Program Files (x86)\Git\ssl\certs" |
| | 69 | {{{ |
| | 70 | [http] |
| | 71 | sslCAPath = C:\\Program Files (x86)\\Git\\ssl\\certs |
| | 72 | }}} |
| | 73 | * 手動で追加する場合、以下のように書いてもよい |
| | 74 | {{{ |
| | 75 | [http] |
| | 76 | sslCAPath = 'C:/Program Files (x86)/Git/ssl/certs' |
| | 77 | }}} |
| | 78 | 2. 証明書の用意 |
| | 79 | * $ openssl x509 -inform der -in cacert.cer -out cacert.pem |
| | 80 | * $ mv cacert.pem `openssl x509 -hash -noout -in cacert.pem`.0 |
| | 81 | * $ ls -l |
| | 82 | {{{ |
| | 83 | total 8671524 |
| | 84 | -rw-r--r-- 1 mitty mitty 1326 Jun 8 02:47 5391e9e0.0 |
| | 85 | -rw------- 1 mitty mitty 937 Feb 19 10:08 cacert.cer |
| | 86 | }}} |
| | 87 | 3. C:\Program Files (x86)\Git\ssl\certs にコピー |
| | 88 | * うまくいかない |
| | 89 | * root証明書ではなくサーバ証明書も追加してみたがだめ |
| | 90 | * C:\Program Files (x86)\Git\bin\curl-ca-bundle.crt にBase64形式(この場合上記{{{5391e9e0.0}}}の中身)で追記する方法~~でもだめ~~ |
| | 91 | * この方法では問題なく独自root証明書が使える |
| | 92 | * ~~いずれも、{{{Unknown SSL protocol error in connection to ...}}} となる~~ |
| | 93 | * SSL通信で使用できるプロトコルを制限したため、接続に失敗していた模様 |
| | 94 | * {{{SSL certificate problem: unable to get local issuer certificate}}}となる |
| | 95 | * git config --system --unset http.sslCAinfo としてもNG |
| | 96 | * UACのために、{{{C:\Program Files (x86)\Git\etc\gitconfig}}}ではなく{{{%LOCALAPPDATA%\VirtualStore\Program Files (x86)\Git\etc\gitconfig}}}に書き込まれる点に注意 |
| | 97 | |
| | 98 | * [http://stackoverflow.com/questions/3777075/ssl-certificate-rejected-trying-to-access-github-over-https-behind-firewall git - SSL certificate rejected trying to access GitHub over HTTPS behind firewall - Stack Overflow] |
| | 99 | > {{{ |
| | 100 | > $ env GIT_SSL_NO_VERIFY=true git clone https://github... |
| | 101 | > }}} |