[ 
https://issues.apache.org/jira/browse/PLC4X-303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17429128#comment-17429128
 ] 

Torsten commented on PLC4X-303:
-------------------------------

Hi [~hutcheb], I have verified at our customer that the patch for an empty 
password works as espected. 
class org.apache.plc4x.java.opcua.context.SecureChannel#getIdentityToken        
    
{{case userTokenTypeUserName:
                //Encrypt the password using the server nonce and server public 
key
                byte[] passwordBytes = this.password == null ? new byte[0] : 
this.password.getBytes();}}

According to Your change "I have added a hostname lookup when trying to resolve 
endpoints": we have the situation that the endpoint (configured using an 
IP4-Address) sends all available endpoints using a hostname like in this URL 
"opc.tcp://br-automation:4840". The client side are not able to resolve the 
hostname "br-automation" and no endpoint is selected.
If have modified method onConnectActivateSessionRequest in class SecureChannel 
as follow:
1. convert endpointDescription.getEndpointUrl().getStringValue() to an URL
2. compare only port and path ignoring the host
if( String.valueOf( url.getPort() ).equals( configuration.getPort() ) && 
url.getPath().equals( configuration.getTransportEndpoint() ) )
3. remove loop: for (String hostEndpoints : endpoints) {
With that changes an endpoint is selected. Should I open another ticket for 
that or miss I something on that point?

> OPCUA should support username / password authentication
> -------------------------------------------------------
>
>                 Key: PLC4X-303
>                 URL: https://issues.apache.org/jira/browse/PLC4X-303
>             Project: Apache PLC4X
>          Issue Type: Wish
>          Components: Driver-OPC-UA
>    Affects Versions: 0.9.0
>            Reporter: Torsten
>            Priority: Major
>         Attachments: screenshot-1.png, screenshot-2.png
>
>
> OPCUA servers might request user authentication, the OPCUA driver should 
> support username and password



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to