Skip to content

Commit

Permalink
pre-testing
Browse files Browse the repository at this point in the history
  • Loading branch information
led0nk committed Feb 14, 2025
1 parent 397ef41 commit 3939111
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions opcua_plugin/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,11 @@ func (g *OPCUAInput) checkForSecurityEndpoints(
"- securityMode: '%s'\n"+
"- securityPolicy: '%s'\n"+
"- serverCertificateFingerprint: '%s'\n"+
"- clientCertificate: '%s'\n"+
"These settings ensure that data is encrypted and that the server's "+
"identity is verified. Without them, encryption is not fully enabled, "+
"which could expose your connection to security risks.",
securityMode, securityPolicy, g.ServerCertificates[ep])
securityMode, securityPolicy, g.ServerCertificates[ep], g.ClientCertificate)
return
}
}
Expand Down Expand Up @@ -589,7 +590,7 @@ func (g *OPCUAInput) connectWithoutSecurity(
return nil, errors.New("error could not connect successfully to any endpoint")
}

// strictConnect establishes a connection to an OPC UA server using the specified
// encryptedConnect establishes a connection to an OPC UA server using the specified
// security mode, policy and server certificate fingerprint.
// It takes a context for cancellation, a list of endpoint descriptions, and an authentication type.
// It returns an OPC UA client if the connection is successful, or an error if it fails.
Expand All @@ -604,7 +605,7 @@ func (g *OPCUAInput) connectWithoutSecurity(
// Returns:
// - *opcua.Client - The connected OPC UA client.
// - error - An error if the connection fails.
func (g *OPCUAInput) strictConnect(
func (g *OPCUAInput) encryptedConnect(
ctx context.Context,
endpoints []*ua.EndpointDescription,
authType ua.UserTokenType,
Expand Down Expand Up @@ -771,7 +772,7 @@ func (g *OPCUAInput) connect(ctx context.Context) error {
// are correctly set, if not we will use 'unencryptedConnect' and
// provide the user with some information.
if g.isSecuritySelected() {
c, err = g.strictConnect(ctx, endpoints, selectedAuthentication)
c, err = g.encryptedConnect(ctx, endpoints, selectedAuthentication)
if err != nil {
g.Log.Infof("Error while connecting using securityMode: '%s',"+
"securityPolicy: '%s', serverCertificateFingerprint: '%s'. err:%v",
Expand Down

0 comments on commit 3939111

Please sign in to comment.