Re: [go-nuts] TLS dial error pkg variables - Best way to logically detect the type of tls failure

2020-06-08 Thread Kevin Chadwick
On 2020-06-08 01:49, Matt Harden wrote: > I suspect your (possibly wrapped) error will be of type > x509.UnknownAuthorityError, so you should be able to check for it with > errors.As: > > var uaerr x509.UnknownAuthorityError > if errors.As(err, &uaerr) { >   // handle as an unknown authority erro

Re: [go-nuts] TLS dial error pkg variables - Best way to logically detect the type of tls failure

2020-06-07 Thread Matt Harden
I suspect your (possibly wrapped) error will be of type x509.UnknownAuthorityError, so you should be able to check for it with errors.As: var uaerr x509.UnknownAuthorityError if errors.As(err, &uaerr) { // handle as an unknown authority error } On Tue, Jun 2, 2020 at 8:22 AM Kevin Chadwick wro

Re: [go-nuts] tls: unsupported SSLv2 handshake received

2019-09-17 Thread Ian Lance Taylor
[ +filippo ] On Tue, Sep 17, 2019 at 1:14 AM Prabhash Rathore wrote: > > Hello, > > We run one of the large volume MTA (Mail Transfer Agent) servers which is > responsible for receiving emails from internet. This SMTP server is > implemented in Golang. > > We notice around 2% of TLS connections

Re: [go-nuts] tls field in struct m

2017-10-31 Thread Ian Lance Taylor
On Tue, Oct 31, 2017 at 11:43 AM, wrote: > > I have one question about tls field in the m struct. > > I see fs:0FFF8h is storing the pointer to current g which is the > first element in tls field. > > In the m struct. tls is an six elements pointer array. I see the last five > has 0 v

Re: [go-nuts] TLS server to save client certificates after a request is received

2017-02-15 Thread Janne Snabb
The certificate byte stream is available in the Raw field of the Certificate struct. You can for example output received certificates PEM encoded like this: for _, c := range r.TLS.PeerCertificates { pem.Encode(os.Stdout, &pem.Block{Type: "CERTIFICATE", Bytes: c.Raw}) } Or you can just save

Re: [go-nuts] TLS

2016-06-27 Thread Sam Whited
On Mon, Jun 27, 2016 at 9:42 AM, Konstantin Khomoutov wrote: > Sure, the standard package crypto/tls has tests, and your installation > of Go comes with full source code of the Go standard library. Reading the source is not the same as documentation or examples; please don't confuse the two. This

Re: [go-nuts] TLS

2016-06-27 Thread Konstantin Khomoutov
On Mon, 27 Jun 2016 20:04:52 +0600 Oleg Puchinin wrote: > Thank you, Dave ! > Mybe you have simple sample for my ? > Server and client initialization. Sure, the standard package crypto/tls has tests, and your installation of Go comes with full source code of the Go standard library. -- You rec

Re: [go-nuts] TLS

2016-06-27 Thread Oleg Puchinin
Thank you, Dave ! Mybe you have simple sample for my ? Server and client initialization. Oleg. 2016-06-27 16:53 GMT+06:00 Dave Cheney : > tls.Dial is what you should use. It's the same as net.Dial, except it > expects the remote end to speak TLS. > > On Monday, 27 June 2016 20:48:06 UTC+10, Oleg

Re: [go-nuts] TLS

2016-06-27 Thread Dave Cheney
tls.Dial is what you should use. It's the same as net.Dial, except it expects the remote end to speak TLS. On Monday, 27 June 2016 20:48:06 UTC+10, Oleg Puchinin wrote: > > I want connect to my TCP server from my client use tls. > > 2016-06-27 16:44 GMT+06:00 Dave Cheney >: > >> If you want to ma

Re: [go-nuts] TLS

2016-06-27 Thread Oleg Puchinin
I want connect to my TCP server from my client use tls. 2016-06-27 16:44 GMT+06:00 Dave Cheney : > If you want to make a connection to a server take speaks TLS, you can use > https://godoc.org/crypto/tls#Dial > > If you want to make a connection to a web server that uses HTTPS, the > net/http pac

Re: [go-nuts] TLS

2016-06-27 Thread Dave Cheney
If you want to make a connection to a server take speaks TLS, you can use https://godoc.org/crypto/tls#Dial If you want to make a connection to a web server that uses HTTPS, the net/http package does this automatically for you. If you can share some more details about what you are trying to do,