I'm wondering how to use godaddy's ssl certificate with GoLang Https server.
currently I'm using the following code:
srv := &http.Server{
Addr: httpsPortStr,
Handler: n,
ReadTimeout: time.Duration(config.CfgIni.ReadTimeout) * time.Second,
WriteTimeout: time.Duration(config.CfgIni.WriteTimeout) * time.Second,
}
err := srv.ListenAndServeTLS(<CERTIFICATE_FILE>,<PRIVATE_KEY_FILE>)
I still have sf_bundle-g2-g1.crt
. how do I add it to the chain of certificates ?
update
@Vonc's answer is really helpful, i'm just missing one last thing. I'm using http.Server instance in order to change ReadTimeout and WriteTimeout parameters. how can I do this with the tls ?
My previous code for this:
srv := &http.Server{
Addr: httpsPortStr,
Handler: n,
ReadTimeout: time.Duration(config.CfgIni.ReadTimeout) * time.Second,
WriteTimeout: time.Duration(config.CfgIni.WriteTimeout) * time.Second,
}
err := srv.ListenAndServeTLS(config.CfgIni.CertificateFile,config.CfgIni.PrivateKeyFile)
thanks!