Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for NoTLSv1_1 and NoTLSv1_2, and allowed options to be cleared #11

Merged
merged 1 commit into from
Oct 8, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions ctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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
Expand All @@ -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 (
Expand Down