From 18121b772568646b1ea428d9b3430b1f347e5d6c Mon Sep 17 00:00:00 2001 From: Joel Sing Date: Tue, 7 Mar 2017 13:00:26 +0000 Subject: Allow ciphers to be set on the TLS config. --- regress/lib/libtls/gotls/tls.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'regress') diff --git a/regress/lib/libtls/gotls/tls.go b/regress/lib/libtls/gotls/tls.go index 0480888093d..41b7d19a8bf 100644 --- a/regress/lib/libtls/gotls/tls.go +++ b/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