Skip to content
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

Changing Application URI in client object #776

Closed
mikelga opened this issue Dec 14, 2018 · 4 comments
Closed

Changing Application URI in client object #776

mikelga opened this issue Dec 14, 2018 · 4 comments

Comments

@mikelga
Copy link

mikelga commented Dec 14, 2018

Hello,
I want to use python-opcua as a client to connect to an OPC-UA server (UA CPP Server). I want to communicate using the security configuration Basic256Sha256 and Sign&Encrypt. After using the function
client.set_security(getattr(security_policies, 'SecurityPolicy' + 'Basic256Sha256'),"/home/ii40asset/klabeak/Python-opcua client/python_client.der","/home/ii40asset/klabeak/Python-opcua client/python_client_key.pem",mode=ua.MessageSecurityMode.SignAndEncrypt)

I see this error in the client:
The URI specified in the ApplicationDescription does not match the URI in the certificate.(BadCertificateUriInvalid)

On the server after clicking on Disable ApplicationURI check, the client works perfectly for me.
But I want to enable again ApplicationURI check.

How can I change this ApplicationURI in the client?

Thanks

@oroulet
Copy link
Member

oroulet commented Dec 15, 2018

look at members of client class, there is one called application_uri for example. But I really do not know what your server wants. Write it down in that bug when you find out

@mikelga
Copy link
Author

mikelga commented Dec 17, 2018

Hi,

I think that I need to write urn:Mikel-PC:UnifiedAutomation:UaServerCpp in application_uri.

I found this in client.py, but I don't know how I can change it:
image

This appears in the server features:
image

Thank you!

@zerox1212
Copy link
Contributor

zerox1212 commented Dec 17, 2018

I think you can just change that attribute.

my_client = Client('some url')
my_client.application_uri = "my URI"

@mikelga
Copy link
Author

mikelga commented Dec 18, 2018

Thanks! It has worked for me

@mikelga mikelga closed this as completed Dec 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants