summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2017-03-07 13:00:26 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2017-03-07 13:00:26 +0000
commit18121b772568646b1ea428d9b3430b1f347e5d6c (patch)
tree6e8cb38d34b9ddd47d5524e0334f350ade2b9e63 /regress
parent091274a0d135e6269238bde2354fadbf592f24cb (diff)
Allow ciphers to be set on the TLS config.
Diffstat (limited to 'regress')
-rw-r--r--regress/lib/libtls/gotls/tls.go10
1 files changed, 10 insertions, 0 deletions
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 {