If it helps, I put this together for my own project - it's not a package 
but a bunch of convenience functions/methods for generating TLS certs and 
keys (there is a lot of implementation specific stuff), but the general 
shape may help you:

https://github.com/itrs-group/cordial/blob/main/tools/geneos/internal/instance/tls.go

Peter

On Tuesday, 28 June 2022 at 01:35:38 UTC+1 hugh....@gmail.com wrote:

> I wish to create a secure private network using a self-signed certificate 
> with a Go web server: See the following code block:
>
> // Code 
>     err := http.ListenAndServeTLS(":"+port, "auto.org.pem", 
> "auto.org-key.pem", handler)
>     if err != nil {
>
>         logError((err.Error()))
>         log.Fatal("ListenAndServe: ", err)
>     }
> // End of Code
>
> Could I auto  generate (and register) the .pem and .key files using GO?  I 
> wish to create a trust certificate if there files do not exist.
>
> I came across the following website:
>
> "https://gist.github.com/shaneutt/5e1995295cff6721c89a71d13a71c251";
>
> I am not sure how to implement this. Your help is appreciated.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/2c4a6aee-0b1f-454b-a725-c4233759ed27n%40googlegroups.com.

Reply via email to