@marcel91200 / caddy Mirror · read-only / commits / 48b5a803
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 14, 05:15 UTC

Remove (unimplemented) enterprise TLS matchers

Matthew Holt committed May 7, 2019 at 11:58 UTC 48b5a803208548d143b7ead9b6fc9b524cd0e031
1 file changed +4 -66
modules/caddytls/matchers.go
+4 -66
@@ -6,46 +6,14 @@ import (
6 "bitbucket.org/lightcodelabs/caddy2"
7 )
8
9 -type (
10 - // MatchServerName matches based on SNI.
11 - MatchServerName []string
12 -
13 - // TODO: these others should be enterprise-only, probably
14 -
15 - // MatchProtocol matches based on protocol.
16 - MatchProtocol []string // TODO: Protocol or version?
17 -
18 - // MatchClientCert matches based on client certificate / client auth?
19 - MatchClientCert struct{} // TODO: client certificate options
20 -
21 - // MatchRemote matches based on the remote address of the connection.
22 - MatchRemote []string
23 -
24 - // MatchStarlark matches based on a Starlark script.
25 - MatchStarlark string
26 -)
9 +// MatchServerName matches based on SNI.
10 +type MatchServerName []string
11
12 func init() {
13 caddy2.RegisterModule(caddy2.Module{
14 Name: "tls.handshake_match.host",
15 New: func() (interface{}, error) { return MatchServerName{}, nil },
16 })
33 - caddy2.RegisterModule(caddy2.Module{
34 - Name: "tls.handshake_match.protocol",
35 - New: func() (interface{}, error) { return MatchProtocol{}, nil },
36 - })
37 - caddy2.RegisterModule(caddy2.Module{
38 - Name: "tls.handshake_match.client_cert",
39 - New: func() (interface{}, error) { return MatchClientCert{}, nil },
40 - })
41 - caddy2.RegisterModule(caddy2.Module{
42 - Name: "tls.handshake_match.remote",
43 - New: func() (interface{}, error) { return MatchRemote{}, nil },
44 - })
45 - caddy2.RegisterModule(caddy2.Module{
46 - Name: "tls.handshake_match.starlark",
47 - New: func() (interface{}, error) { return new(MatchStarlark), nil },
48 - })
17 }
18
19 // Match matches hello based on SNI.
@@ -59,35 +27,5 @@ func (m MatchServerName) Match(hello *tls.ClientHelloInfo) bool {
27 return false
28 }
29
62 -// Match matches hello based on protocol version.
63 -func (m MatchProtocol) Match(hello *tls.ClientHelloInfo) bool {
64 - // TODO: not implemented
65 - return false
66 -}
67 -
68 -// Match matches hello based on client certificate.
69 -func (m MatchClientCert) Match(hello *tls.ClientHelloInfo) bool {
70 - // TODO: not implemented
71 - return false
72 -}
73 -
74 -// Match matches hello based on remote address.
75 -func (m MatchRemote) Match(hello *tls.ClientHelloInfo) bool {
76 - // TODO: not implemented
77 - return false
78 -}
79 -
80 -// Match matches hello based on a Starlark script.
81 -func (m MatchStarlark) Match(hello *tls.ClientHelloInfo) bool {
82 - // TODO: not implemented
83 - return false
84 -}
85 -
86 -// Interface guards
87 -var (
88 - _ ConnectionMatcher = MatchServerName{}
89 - _ ConnectionMatcher = MatchProtocol{}
90 - _ ConnectionMatcher = MatchClientCert{}
91 - _ ConnectionMatcher = MatchRemote{}
92 - _ ConnectionMatcher = new(MatchStarlark)
93 -)
30 +// Interface guard
31 +var _ ConnectionMatcher = MatchServerName{}