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

Feature/add tls support #44

Merged
merged 6 commits into from
Aug 7, 2020
Merged

Conversation

aliiohs
Copy link
Member

@aliiohs aliiohs commented Jul 20, 2020

What this PR does:

for apache/dubbo-go#685

@auto-comment
Copy link

auto-comment bot commented Jul 20, 2020

Thank your for raising your pull request.
Please make sure you have followed our contributing guidelines. We will review it as soon as possible

@aliiohs aliiohs changed the base branch from feature/addTlsSupport to master July 20, 2020 15:10
client.go Outdated Show resolved Hide resolved
server.go Outdated Show resolved Hide resolved
@aliiohs aliiohs marked this pull request as draft July 21, 2020 15:09
client.go Outdated Show resolved Hide resolved
@aliiohs aliiohs marked this pull request as ready for review August 1, 2020 17:05
ClientTrustCertCollectionPath string
}

func (c *ClientTlsConfigBuilder) BuildTlsConfig() (*tls.Config, error) {
Copy link

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.
Copy link

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
Copy link

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
Copy link

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 {
Copy link

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) {
Copy link

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 {
Copy link

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 {
Copy link

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 {
Copy link

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
Copy link

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
Copy link

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) {
Copy link

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
Copy link

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) {
Copy link

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

@AlexStocks AlexStocks merged commit 2c6d646 into apache:master Aug 7, 2020
yqxu pushed a commit to yqxu/dubbo-getty that referenced this pull request Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants