Ngrok: Failed to read message: remote error: bad certificate

Created on 24 Jun 2015  路  2Comments  路  Source: inconshreveable/ngrok

I did the following steps

export NGROK_BASE_DOMAIN="ip"
openssl genrsa -out rootCA.key 2048
openssl req -x509 -new -nodes -key rootCA.key -subj "/CN=$NGROK_BASE_DOMAIN" -days 5000 -out rootCA.pem
openssl genrsa -out device.key 2048
openssl req -new -key device.key -subj "/CN=$NGROK_BASE_DOMAIN" -out device.csr
openssl x509 -req -in device.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out device.crt -days 5000

cp rootCA.pem assets/client/tls/ngrokroot.crt
cp device.crt assets/server/tls/snakeoil.crt
cp device.key assets/server/tls/snakeoil.key

make release-server release-client

run the server side:
$bin/ngrokd -domain="121.199.57.37" -httpAddr=":9000" -tlsKey=./device.key -tlsCrt=./device.crt

run the client side
$./ngrok -config=ngrok.cfg -proto=http -log=stdout 8080

with ngrok.cfg
server_addr: "ip:4443" #ip same as NGROK_BASE_DOMAIN
trust_host_root_certs: false

However, error ocuured:

server side error message:
Failed to read message: remote error: bad certificate
[DEBG] [tun:3f0fcbcc] Closing

client side error message:
control recovering from failure x509: cannot validate certificate for ip because it doesn't contain any IP SANs

So, could anybody help me? What's wrong with this?

Any help will be highly appreciated.

Most helpful comment

Using hostname instead of ip could solve this problem.

All 2 comments

Did you resolve it? (I'm interested in it)

Using hostname instead of ip could solve this problem.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

owlstack picture owlstack  路  5Comments

Conansoloman picture Conansoloman  路  7Comments

IngwiePhoenix picture IngwiePhoenix  路  7Comments

matiasmasca picture matiasmasca  路  6Comments

ricardopieper picture ricardopieper  路  3Comments