Skip to content
Snippets Groups Projects
Commit 7db5c9f7 authored by Jonah Husson's avatar Jonah Husson
Browse files

Merge branch 'hotfix/atomic-cert' into 'release'

Use atomic cert for remote, rename to getremotecertificate

See merge request !59
parents 62f4ec17 912d089a
No related branches found
No related tags found
2 merge requests!59Use atomic cert for remote, rename to getremotecertificate,!39Merge release into master
......@@ -53,7 +53,7 @@ type Connection interface {
IsOnline() (time.Duration, bool)
GetServerCert() (*x509.Certificate, error)
GetRemoteCertificate() (*x509.Certificate, error)
clientConnHelpers
}
......
......@@ -214,7 +214,7 @@ func TestWebConnection_TLS(t *testing.T) {
t.Errorf("Did not receive expected payload")
}
_, err = h.GetServerCert()
_, err = h.GetRemoteCertificate()
if err != nil {
t.Errorf("Did not receive cert: %+v", err)
}
......
......@@ -41,8 +41,8 @@ func (gc *grpcConn) IsWeb() bool {
return false
}
// GetServerCert returns an error on grpc hosts
func (gc *grpcConn) GetServerCert() (*x509.Certificate, error) {
// GetRemoteCertificate returns an error on grpc hosts
func (gc *grpcConn) GetRemoteCertificate() (*x509.Certificate, error) {
return nil, errors.New("GetServerCert not implemented for GRPC hosts")
}
......
......@@ -216,11 +216,11 @@ func (h *Host) IsWeb() bool {
return h.connection.IsWeb()
}
// GetServerCert returns the tls certificate from the server for web hosts
// GetRemoteCertificate returns the tls certificate from the server for web hosts
// Note that this will return an error when used on grpc hosts, and will not
// have a certificate ready until something has been sent over the connection.
func (h *Host) GetServerCert() (*x509.Certificate, error) {
return h.connection.GetServerCert()
func (h *Host) GetRemoteCertificate() (*x509.Certificate, error) {
return h.connection.GetRemoteCertificate()
}
// SetMetricsTesting sets the host metrics to an arbitrary value. Used for testing
......
......@@ -67,9 +67,9 @@ func (wc *webConn) IsWeb() bool {
return true
}
// GetServerCert returns the server tls certificate stored by the web connection
func (wc *webConn) GetServerCert() (*x509.Certificate, error) {
return wc.connection.GetReceivedCertificate()
// GetRemoteCertificate returns the server tls certificate stored by the web connection
func (wc *webConn) GetRemoteCertificate() (*x509.Certificate, error) {
return wc.connection.GetRemoteCertificate()
}
// connectWebHelper initializes the grpcweb ClientConn object
......
......@@ -3,7 +3,7 @@ module gitlab.com/xx_network/comms
go 1.19
require (
git.xx.network/elixxir/grpc-web-go-client v0.0.0-20221220161254-68bee4d4a516
git.xx.network/elixxir/grpc-web-go-client v0.0.0-20221221203224-436c7ab720af
github.com/golang/protobuf v1.5.2
github.com/improbable-eng/grpc-web v0.15.0
github.com/pkg/errors v0.9.1
......
......@@ -5,6 +5,10 @@ git.xx.network/elixxir/grpc-web-go-client v0.0.0-20221220131901-1a7cdcec1831 h1:
git.xx.network/elixxir/grpc-web-go-client v0.0.0-20221220131901-1a7cdcec1831/go.mod h1:uFKw2wmgtlYMdiIm08dM0Vj4XvX9ZKVCj71c8O7SAPo=
git.xx.network/elixxir/grpc-web-go-client v0.0.0-20221220161254-68bee4d4a516 h1:Z1AimDI/+3ZZGcmkQaprDKiDn8oGmha7yyPvkDzIuMI=
git.xx.network/elixxir/grpc-web-go-client v0.0.0-20221220161254-68bee4d4a516/go.mod h1:uFKw2wmgtlYMdiIm08dM0Vj4XvX9ZKVCj71c8O7SAPo=
git.xx.network/elixxir/grpc-web-go-client v0.0.0-20221221203031-c72e32187f30 h1:BpAfpIbpCNIkrUyLajIq+ymrsgKXoc3N930mdQ2OfLQ=
git.xx.network/elixxir/grpc-web-go-client v0.0.0-20221221203031-c72e32187f30/go.mod h1:uFKw2wmgtlYMdiIm08dM0Vj4XvX9ZKVCj71c8O7SAPo=
git.xx.network/elixxir/grpc-web-go-client v0.0.0-20221221203224-436c7ab720af h1:ogiu6sKbFjsKaMnmYSlflJDf973v4TVtBDSnUR2vEPQ=
git.xx.network/elixxir/grpc-web-go-client v0.0.0-20221221203224-436c7ab720af/go.mod h1:uFKw2wmgtlYMdiIm08dM0Vj4XvX9ZKVCj71c8O7SAPo=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment