httpsでcurlコマンドが使用できない

パピーリナックスを初めて使う方

モデレータ: 暇人, YoN, nyu

返信する
ssnys
記事: 64
登録日時: 14/02/19(水) 17:50

httpsでcurlコマンドが使用できない

投稿記事 by ssnys »

普段よりPuppy Linuxを使用させていただいております。

トピックの件名通り、httpsでcurlコマンドが使用できません。

例えばhttps://example.com/へcurlコマンドを使用してもエラーがでてしまいます。

コード: 全て選択

# curl https://example.com/
curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.
https://example.com/に限りません、https://www.google.com/などでも同様にエラーがでてしまいます。

http://example.com/などのhttpですとこの問題は起こりません

コード: 全て選択

# curl http://example.com/
<!doctype html>
<html>
<head>
    <title>Example Domain</title>

    <meta charset="utf-8" />
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <style type="text/css">
    body {
        background-color: #f0f0f2;
        margin: 0;
        padding: 0;
        font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
        
    }
    div {
        width: 600px;
        margin: 5em auto;
        padding: 50px;
        background-color: #fff;
        border-radius: 1em;
    }
    a:link, a:visited {
        color: #38488f;
        text-decoration: none;
    }
    @media (max-width: 700px) {
        body {
            background-color: #fff;
        }
        div {
            width: auto;
            margin: 0 auto;
            border-radius: 0;
            padding: 1em;
        }
    }
    </style>    
</head>

<body>
<div>
    <h1>Example Domain</h1>
    <p>This domain is established to be used for illustrative examples in documents. You may use this
    domain in examples without prior coordination or asking for permission.</p>
    <p><a href="http://www.iana.org/domains/example">More information...</a></p>
</div>
</body>
</html>
自分なりに検索して見たところ、SSLのルート証明書を入れ替えたら治るなどの解決法がありましたが、実際にどう対処していいのかまったくもって不明です。

解決方についてご教授いただければ幸いです。

どうぞ、宜しくお願い致します。

使用しているOSはPuppy Linux 571JPです。
💻Lenovo G550(CPU: Intel Celeron 900 @ 2.20GHz, RAM: 971MB, HDD: 149.05GiB) + Precise-571JP
🖥HITACHI FLORA 310 DL7(CPU: Intel Pentium III 700 MHz, RAM: 384MB) + Precise-571JP
akkie2
記事: 156
登録日時: 10/06/28(月) 11:34
お住まい: 日本、宮崎県

Re: httpsでcurlコマンドが使用できない

投稿記事 by akkie2 »

If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option.
-k オプション付けたら取得できました。
curl -k https://example.com/
マシン:  Toshiba Dynabook K41(i3 2.27GHz),
Puppy: Xenial-pup-7.0.4
ソフト:   マイポータブル版( Wine-MyPortable, Chromium-MyPortable ) を公開してます。
ssnys
記事: 64
登録日時: 14/02/19(水) 17:50

Re: httpsでcurlコマンドが使用できない

投稿記事 by ssnys »

akkie2 さん返信ありがとうございます。

curl -k でエラーが解消できるとは、見落としていました。誠に有難うございます。

ただcurl -kですとサーバ側の証明書のチェックを行わないと考えられるため、中間者攻撃などのセキュリティ上の問題が生じてくるのではないかと思います。

できれば証明書のチェックを行いたいのですが、それにはどのようにすればよろしいでしょうか。

誠に恐れ入りますが、ご教授いただければ幸いです。
💻Lenovo G550(CPU: Intel Celeron 900 @ 2.20GHz, RAM: 971MB, HDD: 149.05GiB) + Precise-571JP
🖥HITACHI FLORA 310 DL7(CPU: Intel Pentium III 700 MHz, RAM: 384MB) + Precise-571JP
akkie2
記事: 156
登録日時: 10/06/28(月) 11:34
お住まい: 日本、宮崎県

Re: httpsでcurlコマンドが使用できない

投稿記事 by akkie2 »

なるほど
えっと。
Vivid-beta2, tahrpup6.0.3ceで、-kなしで取得できました。
CAが整備されていると思われます。
どのファイルかは、まだ調べてません。
分かったらお知らせします。。
マシン:  Toshiba Dynabook K41(i3 2.27GHz),
Puppy: Xenial-pup-7.0.4
ソフト:   マイポータブル版( Wine-MyPortable, Chromium-MyPortable ) を公開してます。
返信する