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

Move web host check to newHost from setCredentials

parent 88011180
No related branches found
No related tags found
2 merge requests!55Use withsecure for tls, don't pass cert,!39Merge release into master
......@@ -116,11 +116,13 @@ func newHost(id *id.ID, address string, cert []byte, params HostParams) (host *H
host.UpdateAddress(address)
// Configure the host credentials
// Configure the transport credentials for GRPC hosts
if !host.IsWeb() {
err = host.setCredentials()
if err != nil {
return
}
}
// Connect immediately if configured to do so
if params.DisableLazyConnection {
......@@ -331,14 +333,11 @@ func (h *Host) disconnect() {
h.transmissionToken.Clear()
}
// setCredentials sets TransportCredentials and RSA PublicKey objects
// setCredentials sets GRPC TransportCredentials and RSA PublicKey objects
// using a PEM-encoded TLS Certificate
func (h *Host) setCredentials() error {
// If no TLS Certificate specified, print a warning and do nothing
if h.IsWeb() {
return nil
}
if h.certificate == nil || len(h.certificate) == 0 {
if TestingOnlyDisableTLS {
jww.WARN.Printf("No TLS Certificate specified!")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment