summaryrefslogtreecommitdiff
path: root/src/regress/lib/libtls/gotls/tls.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/regress/lib/libtls/gotls/tls.go')
-rw-r--r--src/regress/lib/libtls/gotls/tls.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/regress/lib/libtls/gotls/tls.go b/src/regress/lib/libtls/gotls/tls.go
index be75e71f4f..dbd3b717b0 100644
--- a/src/regress/lib/libtls/gotls/tls.go
+++ b/src/regress/lib/libtls/gotls/tls.go
@@ -256,6 +256,16 @@ func (t *TLS) ConnCipher() (string, error) {
256 return C.GoString(cipher), nil 256 return C.GoString(cipher), nil
257} 257}
258 258
259// ConnCipherStrength returns the strength in bits for the symmetric
260// cipher that is used for the connection.
261func (t *TLS) ConnCipherStrength() (int, error) {
262 strength := C.tls_conn_cipher_strength(t.ctx)
263 if strength == 0 {
264 return 0, errors.New("no connection cipher strength")
265 }
266 return int(strength), nil
267}
268
259// Connect attempts to establish an TLS connection to the specified host on 269// Connect attempts to establish an TLS connection to the specified host on
260// the given port. The host may optionally contain a colon separated port 270// the given port. The host may optionally contain a colon separated port
261// value if the port string is specified as an empty string. 271// value if the port string is specified as an empty string.