質問

質問

質問

会社が発行した証明書を必要とするAtlasian Stashに接続する際に問題があります。 Firefox(証明書を含む)を使用して接続するとWebサイトにアクセスできますが、bash(同じUbuntuバージョンベースのPop_OS!20.04)を使用してgitリポジトリを複製しようとすると、次のエラーが発生します。

> git clone https://cmstash.cm.website.com/scm/cded/prototyping.git
    Cloning into 'prototyping'...
    fatal: unable to access 'https://cmstash.cm.website.com/scm/cded/prototyping.git/': gnutls_handshake() failed: Handshake failed

証明書をどのように設定しますか?

3つのファイルがあり、これらはに配置されます。次に、実行時にファイルを実行して選択します4125B9-ca.crt。これは次の警告を提供します。4125B9.crt4125B9.key/usr/share/ca-certificates/work/sudo update-ca-certificates --fresh.crtsudo dpkg-reconfigure ca-certificates

warning: skipping 4125B9-ca.pem,it does not contain exactly one certificate or CRL

問題をデバッグする方法

接続をテストするためにさまざまなコマンドを試しましたが、セキュリティ上の理由から一部の情報が削除されました。

私はopenssl次のように始めますs_client

> sudo openssl s_client -connect cmstash.cm.website.com:443 -CAfile /etc/ssl/certs/ca-certificates.crt -tls1_2

    CONNECTED(00000003)
    [depth 1 & 2 removed]
    depth=0 CN = *.website.com, O = [O removed], OU = IT-Department, OU = CM, [C & L removed]
    verify return:1
    140405633332544:error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure:../ssl/recor /rec_layer_s3.c:1543:SSL alert number 40
    ---
    Certificate chain
    [Certificate chain removed]
    ---
    Server certificate
    -----BEGIN CERTIFICATE-----
    [Certificate removed]
    -----END CERTIFICATE-----
    [Subject and Issuer removed]
    ---
    Acceptable client certificate CA names
    [acceptable client certificate names removed]

    Client Certificate Types: RSA sign, DSA sign, ECDSA sign
    Requested Signature Algorithms: RSA+SHA512:DSA+SHA512:ECDSA+SHA512:RSA+SHA384:DSA+SHA384:ECDSA+SHA384:RSA+SHA256:DSA+SHA256:ECDSA+SHA256:RSA+SHA224:DSA+SHA224:ECDSA+SHA224:RSA+SHA1:DSA+SHA1:ECDSA+SHA1
    Shared Requested Signature Algorithms: RSA+SHA512:DSA+SHA512:ECDSA+SHA512:RSA+SHA384:DSA+SHA384:ECDSA+SHA384:RSA+SHA256:DSA+SHA256:ECDSA+SHA256:RSA+SHA224:DSA+SHA224:ECDSA+SHA224
    Peer signing digest: SHA512
    Peer signature type: RSA
    Server Temp Key: ECDH, P-256, 256 bits
    ---
    SSL handshake has read 4110 bytes and written 447 bytes
    Verification: OK
    ---
    New, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256
    Server public key is 4096 bit
    Secure Renegotiation IS supported
    Compression: NONE
    Expansion: NONE
    No ALPN negotiated
    SSL-Session:
        Protocol  : TLSv1.2
        Cipher    : ECDHE-RSA-AES128-GCM-SHA256
        Session-ID:
        Session-ID-ctx:
        Master-Key: [Master Key removed]
        PSK identity: None
        PSK identity hint: None
        SRP username: None
        Start Time: 1600242853
        Timeout   : 7200 (sec)
        Verify return code: 0 (ok)
        Extended master secret: no
   ---

許可されたクライアント証明書のCA名を確認した後、私の証明書と比較して確認しましたが、CA名は同じでした。

その後、次を使用しようとしますcurl

curl -iv --ciphers DEFAULT@SECLEVEL=1 https://cmstash.website.com
    *   Trying 212.203.27.120:443...
    * TCP_NODELAY set
    * Connected to cmstash.cm.website.com ([IP removed]) port 443 (#0)
    * ALPN, offering h2
    * ALPN, offering http/1.1
    * Cipher selection: DEFAULT@SECLEVEL=1
    * successfully set certificate verify locations:
    *   CAfile: /etc/ssl/certs/ca-certificates.crt
      CApath: /etc/ssl/certs
    * TLSv1.3 (OUT), TLS handshake, Client hello (1):
    * TLSv1.3 (IN), TLS handshake, Server hello (2):
    * TLSv1.2 (IN), TLS handshake, Certificate (11):
    * TLSv1.2 (IN), TLS handshake, Server key exchange (12):
    * TLSv1.2 (IN), TLS handshake, Request CERT (13):
    * TLSv1.2 (IN), TLS handshake, Server finished (14):
    * TLSv1.2 (OUT), TLS handshake, Certificate (11):
    * TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
    * TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
    * TLSv1.2 (OUT), TLS handshake, Finished (20):
    * TLSv1.2 (IN), TLS alert, handshake failure (552):
    * error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure
    * Closing connection 0
    curl: (35) error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure

その後、情報が提供されなくなり、次のことを試みましたgnutls

gnutls-cli -d 0 -V cmstash.cm.website.com:443

    - Status: The certificate is trusted.
    - Server's trusted authorities:
       [Authorities removed]
    - Successfully sent 0 certificate(s) to server.
    *** Fatal error: A TLS fatal alert has been received.
    *** Received alert [40]: Handshake failed

これはgitと直接関係のないTLS問題のようです。残念ながら、エラーメッセージはハンドシェイクが失敗したことを示しており、理由や方法については説明しません。

その他の情報

  • このウェブサイトはSSLv3またはTLS1.3をサポートしていないため、TLS1.2を使用しました。
  • 証明書は有効で、Firefox で使用する場合に機能します。

ベストアンサー1

おすすめ記事