I have a server that runs in NodeJS (express) and I have an issue when trying to to make it https. I was able to manually create a certificate using Certbot
certbot certonly --manual
after that, I set up my express app
const fs = require('fs');
var http = require('http');
var https = require('https');
var express = require('express');
const credentials = {
key: fs.readFileSync('/etc/letsencrypt/live/example/privkey.pem', 'utf8'),
cert: fs.readFileSync('/etc/letsencrypt/live/example/cert.pem', 'utf8'),
ca: fs.readFileSync('/etc/letsencrypt/live/example/chain.pem', 'utf8')
};
const app = express();
// Starting both http & https servers
const httpServer = http.createServer(app);
const httpsServer = https.createServer(credentials, app);
httpServer.listen(80, () => {
console.log('HTTP Server running on port 80');
});
httpsServer.listen(443, () => {
console.log('HTTPS Server running on port 443');
});
but now when I try to access my page via https protocol I am getting errors
in Chrome:
ERR_SSL_VERSION_OR_CIPHER_MISMATCH
in Firefox:
SSL_ERROR_NO_CYPHER_OVERLAP
and when I run curl -I
error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
or curl -Iv
* Rebuilt URL to: https://example.com/
* Trying 90.80.200.30...
* TCP_NODELAY set
* Connected to example.com (90.80.200.30) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS header, Unknown (21):
* TLSv1.2 (IN), TLS alert, Server hello (2):
* error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
* Curl_http_done: called premature == 1
* stopped the pause stream!
* Closing connection 0
curl: (35) error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
I have a server that runs in NodeJS (express) and I have an issue when trying to to make it https. I was able to manually create a certificate using Certbot
certbot certonly --manual
after that, I set up my express app
const fs = require('fs');
var http = require('http');
var https = require('https');
var express = require('express');
const credentials = {
key: fs.readFileSync('/etc/letsencrypt/live/example/privkey.pem', 'utf8'),
cert: fs.readFileSync('/etc/letsencrypt/live/example/cert.pem', 'utf8'),
ca: fs.readFileSync('/etc/letsencrypt/live/example/chain.pem', 'utf8')
};
const app = express();
// Starting both http & https servers
const httpServer = http.createServer(app);
const httpsServer = https.createServer(credentials, app);
httpServer.listen(80, () => {
console.log('HTTP Server running on port 80');
});
httpsServer.listen(443, () => {
console.log('HTTPS Server running on port 443');
});
but now when I try to access my page via https protocol I am getting errors
in Chrome:
ERR_SSL_VERSION_OR_CIPHER_MISMATCH
in Firefox:
SSL_ERROR_NO_CYPHER_OVERLAP
and when I run curl -I
error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
or curl -Iv
* Rebuilt URL to: https://example.com/
* Trying 90.80.200.30...
* TCP_NODELAY set
* Connected to example.com (90.80.200.30) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS header, Unknown (21):
* TLSv1.2 (IN), TLS alert, Server hello (2):
* error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
* Curl_http_done: called premature == 1
* stopped the pause stream!
* Closing connection 0
curl: (35) error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
or via openssl x509 -in /etc/letsencrypt/live/example.com/cert.pem --noout --text
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
30:44:02:20:4A:48:E9:34:36:94:72:A9:DD:65:D0:3F
Signature Algorithm: sha256WithRSAEncryption
Issuer: C = US, O = Let's Encrypt, CN = Let's Encrypt Authority X3
Validity
Not Before: Oct 31 12:53:53 2018 GMT
Not After : Jan 29 12:53:53 2019 GMT
Subject: CN = example.com
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (2048 bit)
Modulus:
30:44:02:20:4A:48:E9:34:36:94:72:A9:DD:65:D0:3F:
…
3E:E7:FE:74:88:FB:A4:8F:28:93:01:9D:DD:F1:DB:FE
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Key Usage: critical
Digital Signature, Key Encipherment
X509v3 Extended Key Usage:
TLS Web Server Authentication, TLS Web Client Authentication
X509v3 Basic Constraints: critical
CA:FALSE
X509v3 Subject Key Identifier:
30:44:02:20:4A:48:E9:34:36:94:72:A9:DD:65:D0:3F:65:D0:3F:65:D0:3F:D0:3F:65:D0
X509v3 Authority Key Identifier:
keyid:30:44:02:20:4A:48:E9:34:36:94:72:A9:DD:65:D0:3F:65:D0:3F:65:D0:3F
Authority Information Access:
OCSP - URI:http://ocsp.int-x3.letsencrypt.org
CA Issuers - URI:http://cert.int-x3.letsencrypt.org/
X509v3 Subject Alternative Name:
DNS:example.com
X509v3 Certificate Policies:
Policy: 2.23.140.1.2.1
Policy: 1.3.6.1.4.1.44947.1.1.1
CPS: http://cps.letsencrypt.org
User Notice:
Explicit Text: This Certificate may only be relied upon by Relying Parties and only in accordance with the Certificate Policy found at https://letsencrypt.org/repository/
CT Precertificate SCTs:
Signed Certificate Timestamp:
Version : v1 (0x0)
Log ID : 30:44:02:20:4A:48:E9:34:36:94:72:A9:DD:65:D0:3F:
30:44:02:20:4A:48:E9:34:36:94:72:A9:DD:65:D0:3F
Timestamp : Oct 31 13:53:53.601 2018 GMT
Extensions: none
Signature : ecdsa-with-SHA256
30:44:02:20:4A:48:E9:34:36:94:72:A9:DD:65:D0:3F:
…
3E:E7:FE:74:88:FB:A4:8F:28:93:01:9D:DD:F1:DB:FE
Signed Certificate Timestamp:
Version : v1 (0x0)
Log ID : 30:44:02:20:4A:48:E9:34:36:94:72:A9:DD:65:D0:3F:
30:44:02:20:4A:48:E9:34:36:94:72:A9:DD:65:D0:3F:
Timestamp : Oct 31 13:53:53.593 2018 GMT
Extensions: none
Signature : ecdsa-with-SHA256
30:44:02:20:4A:48:E9:34:36:94:72:A9:DD:65:D0:3F:
…
3E:E7:FE:74:88:FB:A4:8F:28:93:01:9D:DD:F1:DB:FE
Signature Algorithm: sha256WithRSAEncryption
30:44:02:20:4A:48:E9:34:36:94:72:A9:DD:65:D0:3F:
…
3E:E7:FE:74:88:FB:A4:8F:28:93:01:9D:DD:F1:DB:FE
I was trying to figure out what could be causing this issue and or how could I solve it but I was not able to figure anything out, I tried updating OpenSSL to the latest version, I tried to regenerate the certificate but nothing helped, I’d be very happy for any help whatsoever.