-
Notifications
You must be signed in to change notification settings - Fork 434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request]: Basic256Sha256 policy not implemented? #1844
Comments
Hello @sciortid, With regard to endpoint selection logic - you most likely need to define also message security (message-security=SIGN or SIGN_ENCRYPT) in order to use password authentication. I think spec mandates use of encryption in case of password authentication, however most of software servers are quite relaxed about that. My advise is to try with develop (checkout project and do |
Hello @splatch. Thank you for the support. I admit it's a lack of knowledge from my point of view. Just a bit of context:
So what I'm doing is trying to authenticate with either username+password or certificates. Alo, is the server setup correctly for this scope (authentication with user+sw OR certificate) ? Again, lack of my knowledge, sorry for that, but i just want to ensure that I'm not misinterpreting things:
|
Buongiorno @sciortid,
Looking at your code I think you probably mix certificate authentication with transport level encryption. The OPC-UA protocol can use certificates to secure communication channel as well as to authenticate user. While I know little about python, below lines look more like transport level security: server.load_certificate("certificates/server_certificate.der")
server.load_private_key("certificates/server_private_key.pem") Another point - python code snippet uses Both 0.12 and 0.13-SNAPSHOT support SIGN_ENCRYPT and can work with certificates. The keystore you configure is client private key and certificate used to secure channel. This certificate can be used by server to accept or refuse connection. If you will have a look on https://reference.opcfoundation.org/Core/Part4/v104/docs/7.37 you will find there are few options for tokenType (UserTokenType): Anonymous, Username, Certificate, IssuedToken. We support only first two, however this does not prevent you at all from using certificates to secure channel. |
Ok so certificate authentication method is currently not supported, But You're right, I'm mixing certificates authentication with encryption. I still don't understand the following:
But how is that possible that I'm able to login into the server via PLC4J / UA Expert by just providing the username+password without a certificate?
I again admit to be a noob, but my only explanation to this is that only server certificate matters for communication encryption? Why do you say that the keystore on client side is used to secure channel? |
In case if user does not provide a certificate it will be generated by client. It is an one off certificate which is not retained. For servers which validate transport level certificates we have options to provide PKCS12 encoded certificate and private key. Then you can specify these using following parameters: |
That's clear, thank you again for your patience! |
You're welcome. Please open new issue for certificate authentication once it will be needed. |
Well i really would need it but it really depends on how long would it take 😅 |
It is not a lot of code per say, but I currently miss reference environment where I could test such setup. Prosys Simulation Server docs and forums is a bit cryptic in this regard as a lot people fall in the same trap as you did. For now I've created #1845 so you can sign for updates there. |
I would be glad to help in case you need some dumb tester 😅
|
What would you like to happen?
Hello! First of all I'm pretty sure I'm missing something but i'll try.
I created an OPCUA Python server with username or certificates authentication policies. It has been tested with OPCUA Expert and i can access it with both policies methods.
I (and ChatGPT) created a simple standalone example to connect to the server:
And this is the pom.xml file:
When it runs, I get the "Unable to find endpoint.." exception in this part of SecureChannel.java
And noticed this is because the policyId is set to null but because apparently the hasIdentity function has no option for policy other than anonymous and username:
The policies that my server returns correspond to the ones i set with the python script:
What am I missing? Shouldn't the library allow this kind of access with just the cetificate? I expected other "if" for certificate policies. Did i end up in other functions that should not be used for this policies? In this case, is there something wrong with the main function?
Please note that the example works if i modify the connection string by just adding the username & password, correctly reading the node value:
But it does not surprise me because it is using the username policy in this case (even if Basic256Sha256 is still specified)
Programming Languages
Protocols
The text was updated successfully, but these errors were encountered: