Golang : Getting Echo framework StartAutoTLS to work
Problem:
You want to try out the Echo framework for Golang and somehow cannot get the AutoTLS recipe to work. What's going on and how to get it to work?
Solution:
In order to get the recipe to work. You need an actual domain name. Yes, you will need to buy one or setup a sub-domain.
localhost
or IP address pointing to your web server will not work.
Hence in the documentation:
This recipe demonstrates how to obtain TLS certificates for a domain automatically from Let’s Encrypt. Echo#StartAutoTLS accepts an address which should listen on port 443.
Browse to
https://<DOMAIN>
. If everything goes fine, you should see a welcome message with TLS enabled on the website.
Yup. Focus on the <DOMAIN>
keyword.
Hope this helps!
References:
See also : Golang : Gin framework accept query string by post request example
By Adam Ng
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+22k Find and replace a character in a string in Go
+12.4k Golang : Set image canvas or background to transparent
+13.5k Golang : Find commonalities in two slices or arrays example
+61.4k Golang : Convert HTTP Response body to string
+8.4k Golang : Get all countries currencies code in JSON format
+11.1k Golang : calculate elapsed run time
+3.3k Golang : Converting individual Jawi alphabet to Rumi(Romanized) alphabet example
+8k Golang : Go as a script or running go with shebang/hashbang style
+7.3k Golang : How to check if input string is a word?
+7.7k Golang : Random integer with rand.Seed() within a given range
+5.9k Golang : Takes a plural word and makes it singular
+17.1k Golang : How to get hour, minute, second from time?