diff options
| author | jsing <> | 2017-03-07 13:00:25 +0000 |
|---|---|---|
| committer | jsing <> | 2017-03-07 13:00:25 +0000 |
| commit | 647e6da6f1f0a1afc1ed8852b078e613d182937f (patch) | |
| tree | 6358662730c76b9acf291a7472a801103f24f3c0 /src | |
| parent | cc84ab676c85bc3063edd416a18c745549662c15 (diff) | |
| download | openbsd-647e6da6f1f0a1afc1ed8852b078e613d182937f.tar.gz openbsd-647e6da6f1f0a1afc1ed8852b078e613d182937f.tar.bz2 openbsd-647e6da6f1f0a1afc1ed8852b078e613d182937f.zip | |
Allow ciphers to be set on the TLS config.
Diffstat (limited to 'src')
| -rw-r--r-- | src/regress/lib/libtls/gotls/tls.go | 10 |
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 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 { | |||
| 107 | return nil | 107 | return nil |
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | // SetCiphers sets the cipher suites enabled for the connection. | ||
| 111 | func (c *TLSConfig) SetCiphers(ciphers string) error { | ||
| 112 | cipherStr := C.CString(ciphers) | ||
| 113 | defer C.free(unsafe.Pointer(cipherStr)) | ||
| 114 | if C.tls_config_set_ciphers(c.tlsCfg, cipherStr) != 0 { | ||
| 115 | return c.Error() | ||
| 116 | } | ||
| 117 | return nil | ||
| 118 | } | ||
| 119 | |||
| 110 | // SetProtocols sets the protocol versions enabled for the connection. | 120 | // SetProtocols sets the protocol versions enabled for the connection. |
| 111 | func (c *TLSConfig) SetProtocols(proto ProtocolVersion) error { | 121 | func (c *TLSConfig) SetProtocols(proto ProtocolVersion) error { |
| 112 | if C.tls_config_set_protocols(c.tlsCfg, C.uint32_t(proto)) != 0 { | 122 | if C.tls_config_set_protocols(c.tlsCfg, C.uint32_t(proto)) != 0 { |
