March 2019
Beginner to intermediate
324 pages
7h 17m
English
In the previous section, we obtained some valuable knowledge about how HTTPS actually works. But how do we support it in our code? It's actually fairly simple. In the previous chapter, we utilized the following piece of code to establish an HTTP web server that's empowered by Gin:
//Get gin's default engine r := gin.Default() /* Our code */ //Start listening to incoming HTTP requests... r.Run(address)
We need to apply a single change in the preceding code to support HTTPS instead of HTTP. Here, we are going to use a method called RunTLS(). This method needs three main arguments:
Read now
Unlock full access