Intranet penetration? Ngrok Server Configuration Guide

Source: Internet
Author: User
Tags openssl x509 ssl certificate

1 Installing git and Golang

Apt-get install build-essential Golang mercurial git

2 Download the source, of course, you can not install git, but need to manually upload the code to the desired location.

The unofficial address is used here to fix some packages not available (excerpt from the network)

git clone https://github.com/tutumcloud/ngrok.git Ngrok

3 Generating a self-signed certificate

When using the Ngrok.com official service, we use the official SSL certificate. Self-built NGROKD service, if you do not want to buy an SSL certificate, we need to generate our own self-signed certificate and compile a Ngrok client that carries the certificate.

The certificate generation process requires a ngrok_base_domain. Take Ngrok official randomly generated address xxx.ngrok.com as an example, its ngrok_base_domain is "ngrok.com",

If you want to provide a service with the address "example.ngrok.xxx.com", then Ngrok_base_domain should be "ngrok.xxx.com".

This test, because there is no redundant domain name, I replaced my own two-level domain name "risk001.cn".

CD Ngrok

Ngrok_domain= "risk001.cn"

OpenSSL genrsa-out Base.key 2048

OpenSSL req-new-x509-nodes-key base.key-days 10000-subj "/cn= $NGROK _domain"-out Base.pem

OpenSSL genrsa-out Server.key 2048

OpenSSL req-new-key server.key-subj "/cn= $NGROK _domain"-out SERVER.CSR

OpenSSL x509-req-in server.csr-ca base.pem-cakey base.key-cacreateserial-days 10000-out server.crt

Need to replace certificate when execution is complete

CP Base.pem ASSETS/CLIENT/TLS/NGROKROOT.CRT

Compile

Make Release-server release-client

After successful compilation, the two files of Ngrokd and Ngrok are found in the bin directory. One of the NGROKD is the service-side program.

Start the service side

./bin/ngrokd-tlskey=server.key-tlscrt=server.crt-domain= "risk001.cn"-httpaddr= ":"-httpsAddr= ": 443"

Compiling the Client

(1) Windows

Goos=windows Goarch=amd64 make Release-client

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.