TLSConnectionState retrieves the state of the TLS connection to the server
()
| 2425 | |
| 2426 | // TLSConnectionState retrieves the state of the TLS connection to the server |
| 2427 | func (nc *Conn) TLSConnectionState() (tls.ConnectionState, error) { |
| 2428 | if !nc.isConnected() { |
| 2429 | return tls.ConnectionState{}, ErrDisconnected |
| 2430 | } |
| 2431 | |
| 2432 | nc.mu.RLock() |
| 2433 | conn := nc.conn |
| 2434 | nc.mu.RUnlock() |
| 2435 | |
| 2436 | tc, ok := conn.(*tls.Conn) |
| 2437 | if !ok { |
| 2438 | return tls.ConnectionState{}, ErrConnectionNotTLS |
| 2439 | } |
| 2440 | |
| 2441 | return tc.ConnectionState(), nil |
| 2442 | } |
| 2443 | |
| 2444 | // waitForExits will wait for all socket watcher Go routines to |
| 2445 | // be shutdown before proceeding. |