diff options
author | Matthew Holt <mholt@users.noreply.github.com> | 2019-04-26 12:35:39 -0600 |
---|---|---|
committer | Matthew Holt <mholt@users.noreply.github.com> | 2019-04-26 12:35:39 -0600 |
commit | 43961b542b077f99f78d64629348b9300d3cd4a3 (patch) | |
tree | f4d2b9d8478064912daf1e5de49803afcd7de242 /modules/caddytls/matchers.go | |
parent | 2d056fbe66849f041a233a0d961639fae3835cbb (diff) |
General cleanup and more godocs
Diffstat (limited to 'modules/caddytls/matchers.go')
-rw-r--r-- | modules/caddytls/matchers.go | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/modules/caddytls/matchers.go b/modules/caddytls/matchers.go index c376f87..b308bd0 100644 --- a/modules/caddytls/matchers.go +++ b/modules/caddytls/matchers.go @@ -7,13 +7,22 @@ import ( ) type ( + // MatchServerName matches based on SNI. MatchServerName []string // TODO: these others should be enterprise-only, probably - MatchProtocol []string // TODO: version or protocol? + + // MatchProtocol matches based on protocol. + MatchProtocol []string // TODO: Protocol or version? + + // MatchClientCert matches based on client certificate / client auth? MatchClientCert struct{} // TODO: client certificate options - MatchRemote []string - MatchStarlark string + + // MatchRemote matches based on the remote address of the connection. + MatchRemote []string + + // MatchStarlark matches based on a Starlark script. + MatchStarlark string ) func init() { @@ -39,6 +48,7 @@ func init() { }) } +// Match matches hello based on SNI. func (m MatchServerName) Match(hello *tls.ClientHelloInfo) bool { for _, name := range m { // TODO: support wildcards (and regex?) @@ -49,21 +59,25 @@ func (m MatchServerName) Match(hello *tls.ClientHelloInfo) bool { return false } +// Match matches hello based on protocol version. func (m MatchProtocol) Match(hello *tls.ClientHelloInfo) bool { // TODO: not implemented return false } +// Match matches hello based on client certificate. func (m MatchClientCert) Match(hello *tls.ClientHelloInfo) bool { // TODO: not implemented return false } +// Match matches hello based on remote address. func (m MatchRemote) Match(hello *tls.ClientHelloInfo) bool { // TODO: not implemented return false } +// Match matches hello based on a Starlark script. func (m MatchStarlark) Match(hello *tls.ClientHelloInfo) bool { // TODO: not implemented return false |