Merge pull request #11 from bramp/options

Added support for NoTLSv1_1 and NoTLSv1_2, and allowed options to be cleared
This commit is contained in:
JT Olds
2014-10-08 01:08:50 -06:00

11
ctx.go
View File

@@ -26,6 +26,10 @@ static long SSL_CTX_set_options_not_a_macro(SSL_CTX* ctx, long options) {
return SSL_CTX_set_options(ctx, options);
}
static long SSL_CTX_clear_options_not_a_macro(SSL_CTX* ctx, long options) {
return SSL_CTX_clear_options(ctx, options);
}
static long SSL_CTX_set_mode_not_a_macro(SSL_CTX* ctx, long modes) {
return SSL_CTX_set_mode(ctx, modes);
}
@@ -357,6 +361,8 @@ const (
NoSSLv2 Options = C.SSL_OP_NO_SSLv2
NoSSLv3 Options = C.SSL_OP_NO_SSLv3
NoTLSv1 Options = C.SSL_OP_NO_TLSv1
NoTLSv1_1 Options = C.SSL_OP_NO_TLSv1_1
NoTLSv1_2 Options = C.SSL_OP_NO_TLSv1_2
CipherServerPreference Options = C.SSL_OP_CIPHER_SERVER_PREFERENCE
NoSessionResumptionOrRenegotiation Options = C.SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION
NoTicket Options = C.SSL_OP_NO_TICKET
@@ -369,6 +375,11 @@ func (c *Ctx) SetOptions(options Options) Options {
c.ctx, C.long(options)))
}
func (c *Ctx) ClearOptions(options Options) Options {
return Options(C.SSL_CTX_clear_options_not_a_macro(
c.ctx, C.long(options)))
}
type Modes int
const (