Raise link error when SNI supplied on unsupported link type

Closes #1196
This commit is contained in:
Neil Alexander
2024-10-27 21:06:56 +00:00
parent ff0ef7ff56
commit eef613993f
6 changed files with 16 additions and 0 deletions

View File

@@ -87,6 +87,9 @@ func (l *links) newLinkWS() *linkWS {
}
func (l *linkWS) dial(ctx context.Context, url *url.URL, info linkInfo, options linkOptions) (net.Conn, error) {
if options.tlsSNI != "" {
return nil, ErrLinkSNINotSupported
}
wsconn, _, err := websocket.Dial(ctx, url.String(), &websocket.DialOptions{
Subprotocols: []string{"ygg-ws"},
})