Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

Error connecting to Integration Objects UA Server BadCertificateUriInvalid

More
02 Dec 2023 11:49 #12426 by micham
Thank you. You may close this case.

Michael

Please Log in or Create an account to join the conversation.

More
02 Dec 2023 10:32 #12425 by support
Hello.

Any time you get this error, you need to check the own application certificate - ideally using the OPC UA Administration Dialog.
Further down in the exception, there is this piece of information which has everything in it already:
+ Application URI from the effective application manifest: uri:EBO-OPCClientCFG:MIKE2022
+ Own certificate subject URL name from certificate sub-id "": uri:mike2022:EBOOPCClientCFG:1.0.110.0

You need to fix the difference.

It looks like that you are now specifying the Application URI in the UA application manifest without the version number (which is fine - this is the approach we agreed on).
But there is still an old certificate present, and that one gets used (and it is different and it ) contains the version number

If you were deploying your app with old "scheme" of application URI and now are using a new scheme, everyone doing the upgrade will see the error once, and will need to regenerate the certificate (and then, possibly, reestablish the trust on the server side).

Best regards

Please Log in or Create an account to join the conversation.

More
02 Dec 2023 09:34 #12424 by micham
Hi,

I am getting the error below while trying to connect to Integration Objects OPC UA Simulation Server. I am using QuickOPC NuGet version 5.71.401.

OPC UA service result - {BadCertificateUriInvalid}. The URI specified in the ApplicationDescription does not match the URI in the certificate. BadCertificateUriInvalid



OPC UA Expert can connect with no problems. See below.





Exception details:
Exceptions

Type: OpcLabs.BaseLib.Browsing.BrowseException
Data:
HelpLink:
HResult: -2146233088 (0x80131500)
InnerException:
OpcLabs.EasyOpc.UA.Engine.UAEngineException: UA SDK error (Opc.UA.ServiceResult=0x80170000) in 'static Session.Create'. OPC UA service result - {BadCertificateUriInvalid}. The URI specified in the ApplicationDescription does not match the URI in the certificate. BadCertificateUriInvalid
+ Connection attempt #1; last connected at 1/1/0001 12:00:00 AM (local); unconnected for 00:00:00.
+ This error can be reported by the OPC-UA server if the client application URI has changed but an old application instance certificate was kept. Try to remove and recreate the application instance certificate.
+ Application URI from the effective application manifest: uri:EBO-OPCClientCFG:MIKE2022
+ Own certificate subject URL name from certificate sub-id "": uri:mike2022:EBOOPCClientCFG:1.0.110.0
+ The client method called (or event/callback invoked) was 'BrowseMultiple[1]'. ---> OpcLabs.EasyOpc.UA.UAServiceException: OPC UA service result - {BadCertificateUriInvalid}. The URI specified in the ApplicationDescription does not match the URI in the certificate. BadCertificateUriInvalid
--- End of inner exception stack trace ---
Activity Trace:
Following (26) events were gathered during the action on activity ID [45], in the order of first occurrence:
SDK trace: Imported the PFX private key for [317EC45928DAB83209B9F3FBB73CD35DE2956C71].
2*Exception: {Opc.Ua.ServiceResultException} Certificate is not trusted.
SDK trace: Certificate Validation failed. Reason=BadCertificateUntrusted. [CN=Integration Objects UA Server Simulator] [5AC2015B6D938186041B856CCA48354F51DA3E48]
SDK trace: Validation errors suppressed: [CN=Integration Objects UA Server Simulator] [5AC2015B6D938186041B856CCA48354F51DA3E48]
SDK trace: CreateSession Called. RequestHandle=1, PendingRequestCount=1
SDK trace: ChannelId 0: in Connecting state.
[8] SDK trace: ChannelId 0: SendHelloMessage()
[12] SDK trace: ChannelId 0: ProcessAcknowledgeMessage()
[12] SDK trace: ChannelId 0: in Opening state.
[12] SDK trace: ChannelId 0: Token #0 created. CreatedAt=09:15:49.265. Lifetime=3600000.
[36] SDK trace: ChannelId 0: ProcessOpenSecureChannelResponse()
2*[36] Exception: {Opc.Ua.ServiceResultException} Certificate is not trusted.
[36] SDK trace: Certificate Validation failed. Reason=BadCertificateUntrusted. [CN=Integration Objects UA Server Simulator] [5AC2015B6D938186041B856CCA48354F51DA3E48]
[36] SDK trace: Validation errors suppressed: [CN=Integration Objects UA Server Simulator] [5AC2015B6D938186041B856CCA48354F51DA3E48]
[36] SDK trace: Security Policy: opcfoundation.org/UA/SecurityPolicy#Basic256Sha256
[36] SDK trace: Sender Certificate: [CN=Integration Objects UA Server Simulator] [5AC2015B6D938186041B856CCA48354F51DA3E48]
[36] SDK trace: ChannelId 9: Token #1 activated. CreatedAt=09:15:49.265. Lifetime=3600000.
[36] SDK trace: ChannelId 9: in Open state.
[36] SDK trace: ChannelId 9: Token Expiry 12/02/2023 10:15:49, renewal scheduled in 2699943 ms.
[12] SDK trace: ChannelId 9: ProcessResponseMessage()
2*Exception: {Opc.Ua.ServiceResultException} BadCertificateUriInvalid
SDK trace: CreateSession Completed. RequestHandle=1, PendingRequestCount=0, StatusCode=-2147483648
*Event list length limit exceeded*
Events starting with activity ID in [] may not necessarily be related to the current action.

Data:
ErrorId_{045406CD-8EEA-4F21-B3D6-DC9DB5A34E58}: OpcLabs.UAEngine=1
7b4d9f28-22a8-41d6-93ea-e4d8c2a75da8:
((45, 1), Opc.Ua.TraceEventArgs)
((45, 1), System.Runtime.ExceptionServices.FirstChanceExceptionEventArgs)
((45, 1), System.Runtime.ExceptionServices.FirstChanceExceptionEventArgs)
((45, 1), Opc.Ua.TraceEventArgs)
((45, 1), Opc.Ua.TraceEventArgs)
((45, 1), Opc.Ua.TraceEventArgs)
((45, 1), Opc.Ua.TraceEventArgs)
((8, 0), Opc.Ua.TraceEventArgs)
((12, 0), Opc.Ua.TraceEventArgs)
((12, 0), Opc.Ua.TraceEventArgs)
((12, 0), Opc.Ua.TraceEventArgs)
((36, 0), Opc.Ua.TraceEventArgs)
((36, 0), System.Runtime.ExceptionServices.FirstChanceExceptionEventArgs)
((36, 0), System.Runtime.ExceptionServices.FirstChanceExceptionEventArgs)
((36, 0), Opc.Ua.TraceEventArgs)
((36, 0), Opc.Ua.TraceEventArgs)
((36, 0), Opc.Ua.TraceEventArgs)
((36, 0), Opc.Ua.TraceEventArgs)
((36, 0), Opc.Ua.TraceEventArgs)
((36, 0), Opc.Ua.TraceEventArgs)
((36, 0), Opc.Ua.TraceEventArgs)
((12, 0), Opc.Ua.TraceEventArgs)
((45, 1), System.Runtime.ExceptionServices.FirstChanceExceptionEventArgs)
((45, 1), Opc.Ua.TraceEventArgs)
((45, 1), System.Runtime.ExceptionServices.FirstChanceExceptionEventArgs)
((45, 1), *Event list length limit exceeded*)
c3c0e69e-bf8f-4bfa-8e93-816783737e55: 45
8970fe52-aaa4-40f7-9a6e-74cdcee56724: static Session.Create
OpcLabs.EasyOpc.UA.Implementation.ErrorEnhancingEasyUAClient.Processed: True
Error Code: 1
HelpLink:
HResult: -2146232832 (0x80131600)
InnerException: OpcLabs.EasyOpc.UA.UAServiceException: OPC UA service result - {BadCertificateUriInvalid}. The URI specified in the ApplicationDescription does not match the URI in the certificate. BadCertificateUriInvalid
Data:
ErrorId_{045406CD-8EEA-4F21-B3D6-DC9DB5A34E58}: Opc.UA.ServiceResult=0x80170000
OpcLabs.EasyOpc.UA.Implementation.ErrorEnhancingEasyUAClient.Processed: True
Help Link:
HResult: -2146232832 (0x80131600)
InnerException:
Internal Code: 2148990976
Message: OPC UA service result - {BadCertificateUriInvalid}. The URI specified in the ApplicationDescription does not match the URI in the certificate. BadCertificateUriInvalid
Service Result: BadCertificateUriInvalid
Additional Info:
Description:
Inner Result:
Message: The URI specified in the ApplicationDescription does not match the URI in the certificate.
Qualified Symbolic ID:
Expanded Text:
Is Null: True
Is Standard: True
Name:
Namespace Index: 0
Namespace URI:
Namespace URI String:
Standard Name:
Status Code: BadCertificateUriInvalid
Code Bits: 32791
Code Bits Symbol: BadCertificateUriInvalid
Condition: 23
Description: The URI specified in the ApplicationDescription does not match the URI in the certificate.
Flag Bits: 0
Has Data Value Info: False
Info Type: NotUsed
Internal Value: 2148990976
Is Bad: True
Is Good: False
Is Uncertain: False
Limit Info: None
Overflow: False
Semantics Changed: False
Severity: BadOrFailure
Status Info: Error
Structure Changed: False
Text: {BadCertificateUriInvalid}. The URI specified in the ApplicationDescription does not match the URI in the certificate.
Service Target Site: Void ValidateResponse(Opc.Ua.ResponseHeader)
DeclaringType: Opc.Ua.ClientBase
Module: Opc.Ua.Core.dll
Assembly: Opc.Ua.Core, Version=1.4.371.0, Culture=neutral, PublicKeyToken=bfa7a73c5cf4b6e8
CustomAttributes:
FullyQualifiedName: C:\Program Files (x86)\Control-See\EBO-OPC Client\BIN\Opc.Ua.Core.dll
MDStreamVersion: 131072
MetadataToken: 1
ModuleHandle: System.ModuleHandle
MDStreamVersion: 131072
ModuleVersionId: e90038f5-d9d5-4c0c-b2e7-eda655301ec4
Name: Opc.Ua.Core.dll
ScopeName: Opc.Ua.Core.dll
Source: Opc.Ua.Core
Stack Trace:
at Opc.Ua.ClientBase.ValidateResponse(ResponseHeader header)
at Opc.Ua.SessionClient.CreateSession(RequestHeader requestHeader, ApplicationDescription clientDescription, String serverUri, String endpointUrl, String sessionName, Byte[] clientNonce, Byte[] clientCertificate, Double requestedSessionTimeout, UInt32 maxResponseMessageSize, NodeId& sessionId, NodeId& authenticationToken, Double& revisedSessionTimeout, Byte[]& serverNonce, Byte[]& serverCertificate, EndpointDescriptionCollection& serverEndpoints, SignedSoftwareCertificateCollection& serverSoftwareCertificates, SignatureData& serverSignature, UInt32& maxRequestMessageSize)
at Opc.Ua.Client.Session.CreateSession(RequestHeader requestHeader, ApplicationDescription clientDescription, String serverUri, String endpointUrl, String sessionName, Byte[] clientNonce, Byte[] clientCertificate, Double requestedSessionTimeout, UInt32 maxResponseMessageSize, NodeId& sessionId, NodeId& authenticationToken, Double& revisedSessionTimeout, Byte[]& serverNonce, Byte[]& serverCertificate, EndpointDescriptionCollection& serverEndpoints, SignedSoftwareCertificateCollection& serverSoftwareCertificates, SignatureData& serverSignature, UInt32& maxRequestMessageSize)
at OpcLabs.EasyOpc.UA.Sdk.Shims.SessionShim.CreateSession(RequestHeader requestHeader, ApplicationDescription clientDescription, String serverUri, String endpointUrl, String sessionName, Byte[] clientNonce, Byte[] clientCertificate, Double millisecondsRequestedSessionTimeout, UInt32 maxResponseMessageSize, NodeId& sessionId, NodeId& authenticationToken, Double& millisecondsRevisedSessionTimeout, Byte[]& serverNonce, Byte[]& serverCertificate, EndpointDescriptionCollection& serverEndpoints, SignedSoftwareCertificateCollection& serverSoftwareCertificates, SignatureData& serverSignature, UInt32& maxRequestMessageSize)
at OpcLabs.EasyOpc.UA.Sdk.Shims.SessionShim.Open2(String sessionName, UInt32 sessionTimeout, IUserIdentity identity, IList`1 preferredLocales, Boolean checkDomain)
at OpcLabs.EasyOpc.UA.Sdk.Shims.SessionShim.<Create>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at OpcLabs.EasyOpc.UA.Toolkit.Sdk.ToolkitSession.<Create>d__2.MoveNext()
TargetSite:
Message:
UA SDK error (Opc.UA.ServiceResult=0x80170000) in 'static Session.Create'. OPC UA service result - {BadCertificateUriInvalid}. The URI specified in the ApplicationDescription does not match the URI in the certificate. BadCertificateUriInvalid
+ Connection attempt #1; last connected at 1/1/0001 12:00:00 AM (local); unconnected for 00:00:00.
+ This error can be reported by the OPC-UA server if the client application URI has changed but an old application instance certificate was kept. Try to remove and recreate the application instance certificate.
+ Application URI from the effective application manifest: uri:EBO-OPCClientCFG:MIKE2022
+ Own certificate subject URL name from certificate sub-id "": uri:mike2022:EBOOPCClientCFG:1.0.110.0
+ The client method called (or event/callback invoked) was 'BrowseMultiple[1]'.
Source:
Stack Trace:
== Activity Trace ==
Following (26) events were gathered during the action on activity ID [45], in the order of first occurrence:
SDK trace: Imported the PFX private key for [317EC45928DAB83209B9F3FBB73CD35DE2956C71].
2*Exception: {Opc.Ua.ServiceResultException} Certificate is not trusted.
SDK trace: Certificate Validation failed. Reason=BadCertificateUntrusted. [CN=Integration Objects UA Server Simulator] [5AC2015B6D938186041B856CCA48354F51DA3E48]
SDK trace: Validation errors suppressed: [CN=Integration Objects UA Server Simulator] [5AC2015B6D938186041B856CCA48354F51DA3E48]
SDK trace: CreateSession Called. RequestHandle=1, PendingRequestCount=1
SDK trace: ChannelId 0: in Connecting state.
[8] SDK trace: ChannelId 0: SendHelloMessage()
[12] SDK trace: ChannelId 0: ProcessAcknowledgeMessage()
[12] SDK trace: ChannelId 0: in Opening state.
[12] SDK trace: ChannelId 0: Token #0 created. CreatedAt=09:15:49.265. Lifetime=3600000.
[36] SDK trace: ChannelId 0: ProcessOpenSecureChannelResponse()
2*[36] Exception: {Opc.Ua.ServiceResultException} Certificate is not trusted.
[36] SDK trace: Certificate Validation failed. Reason=BadCertificateUntrusted. [CN=Integration Objects UA Server Simulator] [5AC2015B6D938186041B856CCA48354F51DA3E48]
[36] SDK trace: Validation errors suppressed: [CN=Integration Objects UA Server Simulator] [5AC2015B6D938186041B856CCA48354F51DA3E48]
[36] SDK trace: Security Policy: opcfoundation.org/UA/SecurityPolicy#Basic256Sha256
[36] SDK trace: Sender Certificate: [CN=Integration Objects UA Server Simulator] [5AC2015B6D938186041B856CCA48354F51DA3E48]
[36] SDK trace: ChannelId 9: Token #1 activated. CreatedAt=09:15:49.265. Lifetime=3600000.
[36] SDK trace: ChannelId 9: in Open state.
[36] SDK trace: ChannelId 9: Token Expiry 12/02/2023 10:15:49, renewal scheduled in 2699943 ms.
[12] SDK trace: ChannelId 9: ProcessResponseMessage()
2*Exception: {Opc.Ua.ServiceResultException} BadCertificateUriInvalid
SDK trace: CreateSession Completed. RequestHandle=1, PendingRequestCount=0, StatusCode=-2147483648
*Event list length limit exceeded*
Events starting with activity ID in [] may not necessarily be related to the current action.

TargetSite:
Message: Problem browsing OPC Unified Architecture nodes.
Source:
StackTrace:
TargetSite:

Any idea how to fix?

Thank you.

Michael
Attachments:

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.167 seconds