Re: [go-nuts] SSL socket listener

2020-06-04 Thread Brian Candler
https://golang.org/pkg/crypto/tls/#example_LoadX509KeyPair sets up a basic listener. Once you have this, it's just like a normal socket accept. See https://golang.org/pkg/net/#example_Listener for how to accept connections and handle them in their own goroutines. -- You received this message

Re: [go-nuts] SSL socket listener

2020-06-04 Thread 'Wesley Peng' via golang-nuts
Thanks. how about the sample of general socket listener with SSL rather than net/http implementation? Regards Dimas Prawira wrote: Here is an example running server with TLS package main import ( "net/http" "log" ) func HelloServer(w http.ResponseWriter,req *http.Request) {

Re: [go-nuts] SSL socket listener

2020-06-03 Thread Dimas Prawira
Here is an example running server with TLS package main import ( "net/http" "log" ) func HelloServer(w http.ResponseWriter, req *http.Request) { w.Header().Set("Content-Type", "text/plain") w.Write([]byte("This is an example server.\n")) } func main() {

[go-nuts] SSL socket listener

2020-06-03 Thread 'Wesley Peng' via golang-nuts
Hello, How do I program with SSL to make a server listen on specific port which accepts SSL transfer only? Is there any guide for this since I have no experience on SSL socket programming. Thanks. Wesley Peng wesleyp...@aol.com -- You received this message because you are subscribed to the