diff --git a/e2e-polybft/e2e/jsonrpc_test.go b/e2e-polybft/e2e/jsonrpc_test.go index 7ef7fc3bb2..ca6babe01f 100644 --- a/e2e-polybft/e2e/jsonrpc_test.go +++ b/e2e-polybft/e2e/jsonrpc_test.go @@ -26,7 +26,7 @@ func TestE2E_JsonRPC(t *testing.T) { cluster := framework.NewTestCluster(t, 4, framework.WithPremine(types.Address(acct.Address())), - // framework.WithHttps("/etc/ssl/certs/ssl-cert-snakeoil.pem", "/etc/ssl/private/ssl-cert-snakeoil.key"), + // framework.WithHTTPS("/etc/ssl/certs/ssl-cert-snakeoil.pem", "/etc/ssl/private/ssl-cert-snakeoil.key"), ) defer cluster.Stop() diff --git a/e2e-polybft/framework/test-cluster.go b/e2e-polybft/framework/test-cluster.go index 65a20368cc..ed763d2df7 100644 --- a/e2e-polybft/framework/test-cluster.go +++ b/e2e-polybft/framework/test-cluster.go @@ -466,7 +466,7 @@ func WithPredeploy(predeployString string) ClusterOption { } } -func WithHttps(certFile string, keyFile string) ClusterOption { +func WithHTTPS(certFile string, keyFile string) ClusterOption { return func(h *TestClusterConfig) { h.TLSCertFile = certFile h.TLSKeyFile = keyFile diff --git a/e2e-polybft/framework/test-server.go b/e2e-polybft/framework/test-server.go index 9a2fbbdd9d..80c8f4ff51 100644 --- a/e2e-polybft/framework/test-server.go +++ b/e2e-polybft/framework/test-server.go @@ -69,6 +69,7 @@ func (t *TestServer) GrpcAddr() string { func (t *TestServer) JSONRPCAddr() string { if t.config.TLSCertFile != "" && t.config.TLSKeyFile != "" { host, _ := os.Hostname() + return fmt.Sprintf("https://%s:%d", host, t.config.JSONRPCPort) } else { return fmt.Sprintf("http://%s:%d", hostIP, t.config.JSONRPCPort) diff --git a/jsonrpc/jsonrpc.go b/jsonrpc/jsonrpc.go index 19f0672717..e6519c1a85 100644 --- a/jsonrpc/jsonrpc.go +++ b/jsonrpc/jsonrpc.go @@ -135,6 +135,7 @@ func (j *JSONRPC) setupHTTP() error { if j.config.TLSCertFile != "" && j.config.TLSKeyFile != "" { j.logger.Info("https cert file", j.config.TLSCertFile) j.logger.Info("https key file", j.config.TLSKeyFile) + go func() { if err := srv.ServeTLS(lis, j.config.TLSCertFile, j.config.TLSKeyFile); err != nil { j.logger.Error("closed https connection", "err", err)