Skip to content

Certificates using mkcet fail handshake #250

@mglaman

Description

@mglaman

I'm using DDEV to run a local API, which leverages mkcert (https://mkcert.org/) to allow valid localhost HTTPS certificates. cURL is happy with it

curl -I https://drupex.ddev.site/                                                                                                                                                  
HTTP/2 200
server: nginx/1.17.10
date: Sun, 13 Sep 2020 17:47:39 GMT
content-type: text/html; charset=UTF-8
vary: Accept-Encoding
cache-control: must-revalidate, no-cache, private
x-drupal-dynamic-cache: MISS
x-ua-compatible: IE=edge
content-language: en
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
expires: Sun, 19 Nov 1978 05:00:00 GMT
x-generator: Drupal 8 (https://www.drupal.org)
x-drupal-cache: HIT

But I'm getting the following error when trying to connect using react/http, and I tracked the error to StreamEncryption (or so)

Connection to drupex.ddev.site:443 failed during TLS handshake: Unable to complete TLS handshake: SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed

It looks like the promise fails here

            if (\feof($socket) || $error === null) {
                // EOF or failed without error => connection closed during handshake
                $d->reject(new \UnexpectedValueException(
                    'Connection lost during TLS handshake',
                    \defined('SOCKET_ECONNRESET') ? \SOCKET_ECONNRESET : 0
                ));
            } else {
                // handshake failed with error message
                $d->reject(new \UnexpectedValueException(
                    'Unable to complete TLS handshake: ' . $error
                ));
            }

mkcert installs certificate so that they're valid in the system trust store

Using the local CA at "/Users/mglaman/Library/Application Support/mkcert" ✨
The local CA is already installed in the system trust store! 👍
The local CA is already installed in the Firefox trust store! 👍

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions