[Solved] ngrok 1.7 Build Error: remote error: tls: bad certificate

Ngrok 1.7 build error

The ngrok server has been rebuilt recently. Refer to: https://zhuanlan.zhihu.com/p/33794707
Since the version of ngrok V1 has not been maintained for a long time, after compilation, the server encountered an error at startup: Remote Error: TLS: bad certificate


after searching the Internet for a long time, some people said it was the problem of the golang version, After reducing the version of golang from 1.17 to 1.9, it is still not solved. I accidentally found the log prompt x509 on the client: certificate is valid for XXX, not ngrokd.ngrok.com. I found that it may be the problem of the certificate domain name.

After searching the source code, I found that the default domain name address is ngrokd.ngrok.com, so I found a solution,
find the client source code and change the configuration. The file is:

vim ./src/ngrok/client/model.go

The defaultserveraddr in line 24 is changed to its own server domain name and port

When recompiling the self signed certificate, the domain name of the certificate must exactly match the default address here, otherwise an error will be reported.

Read More: