From 647e6da6f1f0a1afc1ed8852b078e613d182937f Mon Sep 17 00:00:00 2001 From: jsing <> Date: Tue, 7 Mar 2017 13:00:25 +0000 Subject: Allow ciphers to be set on the TLS config. --- src/regress/lib/libtls/gotls/tls.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/regress/lib/libtls/gotls/tls.go b/src/regress/lib/libtls/gotls/tls.go index 0480888093..41b7d19a8b 100644 --- a/src/regress/lib/libtls/gotls/tls.go +++ b/src/regress/lib/libtls/gotls/tls.go @@ -107,6 +107,16 @@ func (c *TLSConfig) SetCAFile(filename string) error { return nil } +// SetCiphers sets the cipher suites enabled for the connection. +func (c *TLSConfig) SetCiphers(ciphers string) error { + cipherStr := C.CString(ciphers) + defer C.free(unsafe.Pointer(cipherStr)) + if C.tls_config_set_ciphers(c.tlsCfg, cipherStr) != 0 { + return c.Error() + } + return nil +} + // SetProtocols sets the protocol versions enabled for the connection. func (c *TLSConfig) SetProtocols(proto ProtocolVersion) error { if C.tls_config_set_protocols(c.tlsCfg, C.uint32_t(proto)) != 0 { -- cgit v1.2.3-55-g6feb