-
Notifications
You must be signed in to change notification settings - Fork 70
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
Feature/add tls support #44
Conversation
Thank your for raising your pull request. |
9d13dd2
to
af46070
Compare
ClientTrustCertCollectionPath string | ||
} | ||
|
||
func (c *ClientTlsConfigBuilder) BuildTlsConfig() (*tls.Config, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported method ClientTlsConfigBuilder.BuildTlsConfig should have comment or be unexported
method BuildTlsConfig should be BuildTLSConfig
@@ -110,9 +130,23 @@ func WithConnectionNumber(num int) ClientOption { | |||
} | |||
} | |||
|
|||
// @cert is client certificate file. it can be empty. | |||
// @certs is client certificate file. it can be empty. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment on exported function WithRootCertificateFile should be of the form "WithRootCertificateFile ..."
@@ -61,13 +63,27 @@ func WithWebsocketServerPrivateKey(key string) ServerOption { | |||
} | |||
} | |||
|
|||
// @cert is the root certificate file to verify the legitimacy of server | |||
// @certs is the root certificate file to verify the legitimacy of server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment on exported function WithWebsocketServerRootCert should be of the form "WithWebsocketServerRootCert ..."
@@ -47,7 +49,7 @@ func WithWebsocketServerPath(path string) ServerOption { | |||
} | |||
} | |||
|
|||
// @cert: server certificate file | |||
// @certs: server certificate file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment on exported function WithWebsocketServerCert should be of the form "WithWebsocketServerCert ..."
return config, nil | ||
} | ||
|
||
type ClientTlsConfigBuilder struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported type ClientTlsConfigBuilder should have comment or be unexported
type ClientTlsConfigBuilder should be ClientTLSConfigBuilder
ServerTrustCertCollectionPath string | ||
} | ||
|
||
func (s *ServerTlsConfigBuilder) BuildTlsConfig() (*tls.Config, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported method ServerTlsConfigBuilder.BuildTlsConfig should have comment or be unexported
method BuildTlsConfig should be BuildTLSConfig
BuildTlsConfig() (*tls.Config, error) | ||
} | ||
|
||
type ServerTlsConfigBuilder struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported type ServerTlsConfigBuilder should have comment or be unexported
type ServerTlsConfigBuilder should be ServerTLSConfigBuilder
perrors "github.com/pkg/errors" | ||
) | ||
|
||
type TlsConfigBuilder interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported type TlsConfigBuilder should have comment or be unexported
type TlsConfigBuilder should be TLSConfigBuilder
} | ||
|
||
// @WithClientKeyCertChainPath sslConfig is tls config | ||
func WithClientTlsConfigBuilder(tlsConfigBuilder TlsConfigBuilder) ClientOption { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func WithClientTlsConfigBuilder should be WithClientTLSConfigBuilder
} | ||
} | ||
|
||
// @WithServerKeyCertChainPath sslConfig is tls config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment on exported function WithServerTlsConfigBuilder should be of the form "WithServerTlsConfigBuilder ..."
func WithWebsocketServerRootCert(cert string) ServerOption { | ||
return func(o *ServerOptions) { | ||
o.caCert = cert | ||
} | ||
} | ||
|
||
// @WithSslEnabled enable use tls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment on exported function WithServerSslEnabled should be of the form "WithServerSslEnabled ..."
util.WaitCloseSignals(server) | ||
} | ||
|
||
func NewHelloServerSession(session getty.Session) (err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported function NewHelloServerSession should have comment or be unexported
taskPoolQueueNumber = flag.Int("task_queue_number", 4, "task queue number") | ||
taskPoolSize = flag.Int("task_pool_size", 2000, "task poll size") | ||
pprofPort = flag.Int("pprof_port", 65432, "pprof http port") | ||
Sessions []getty.Session |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported var Sessions should have comment or be unexported
EventListener = &hello.MessageHandler{} | ||
) | ||
|
||
func InitialSession(session getty.Session) (err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported function InitialSession should have comment or be unexported
Fix: Send multiple pkgs repetitive by tcp
What this PR does:
for apache/dubbo-go#685