convertersystems / opc-ua-samples

Sample HMIs using OPC Unified Architecture (OPC UA) and Visual Studio.
MIT License
106 stars 43 forks source link

Mssing certificate or what? #3

Closed mikakaraila closed 7 years ago

mikakaraila commented 7 years ago

Trying to use sample console in other environment and I got these messages: Step 4 - Create a session with your server.

(Filename: C:\buildslave\unity\build\artifacts/generated/Metro/runtime/UnityEngineDebugBindings.gen.cpp Line: 45)

[2016/12/11 08:33:45][10][Informational][X509CertificateExtensions.cs:110][GetCertificate] Found certificate 'CN=MyHomework, DC=TREL16087112.VSTAGE.CO'. [2016/12/11 08:33:45][10][Informational][X509CertificateExtensions.cs:110][GetCertificate] Found certificate 'CN=MyHomework, DC=TREL16087112.VSTAGE.CO'. [2016/12/11 08:33:45][10][Informational][X509CertificateExtensions.cs:110][GetCertificate] Found certificate 'CN=MyHomework, DC=TREL16087112.VSTAGE.CO'. The thread 0xa54 has exited with code 0 (0x0). Workstation.ServiceModel.Ua.Channels.UaTcpSessionChannel

(Filename: C:\buildslave\unity\build\artifacts/generated/Metro/runtime/UnityEngineDebugBindings.gen.cpp Line: 45)

The thread 0xda0 has exited with code 0 (0x0). The thread 0x818 has exited with code 0 (0x0). The thread 0x102c has exited with code 0 (0x0). The thread 0x444 has exited with code 0 (0x0). [2016/12/11 08:33:57][10][Verbose][CommunicationObject.cs:422][OnOpeningAsync] Channel opening. [2016/12/11 08:33:57][10][Verbose][CommunicationObject.cs:422][OnOpeningAsync] Channel opening. [2016/12/11 08:33:57][10][Verbose][CommunicationObject.cs:422][OnOpeningAsync] Channel opening. [2016/12/11 08:33:57][19][Error][CommunicationObject.cs:359][OnFaulted] Channel faulted. [2016/12/11 08:33:58][19][Error][CommunicationObject.cs:359][OnFaulted] Channel faulted. [2016/12/11 08:33:58][19][Error][CommunicationObject.cs:359][OnFaulted] Channel faulted. Exception thrown: 'System.Net.Sockets.SocketException' in mscorlib.ni.dll [2016/12/11 08:33:58][20][Verbose][CommunicationObject.cs:329][OnClosingAsync] Channel closing. [2016/12/11 08:33:58][20][Verbose][CommunicationObject.cs:329][OnClosingAsync] Channel closing. [2016/12/11 08:33:58][20][Verbose][CommunicationObject.cs:329][OnClosingAsync] Channel closing. [2016/12/11 08:33:58][20][Verbose][CommunicationObject.cs:298][OnClosedAsync] Channel closed. [2016/12/11 08:33:58][20][Verbose][CommunicationObject.cs:298][OnClosedAsync] Channel closed. [2016/12/11 08:33:58][20][Verbose][CommunicationObject.cs:298][OnClosedAsync] Channel closed. Exception thrown: 'System.AggregateException' in mscorlib.ni.dll Exception thrown: 'System.AggregateException' in mscorlib.ni.dll One or more errors occurred. (Channel faulted.)

awcullen commented 7 years ago

Hi Mika,

Looks like the client has found a certificate 'CN=MyHomework, DC=TREL16087112.VSTAGE.CO' and is sending it to the server. Then the channel is faulting.

The most common cause is that the server is not trusting this certificate. Many servers have a tool for displaying the ‘rejected’ certificates and allowing you to ‘trust’ them.

Andrew

mikakaraila commented 7 years ago

Ack I am using node-opcua server.

13.12.2016 15.29 "Andrew Cullen" notifications@github.com kirjoitti:

Hi Mika,

Looks like the client has found a certificate 'CN=MyHomework, DC= TREL16087112.VSTAGE.CO' and is sending it to the server. Then the channel is faulting.

The most common cause is that the server is not trusting this certificate. Many servers have a tool for displaying the ‘rejected’ certificates and allowing you to ‘trust’ them.

Andrew

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/convertersystems/opc-ua-samples/issues/3#issuecomment-266738364, or mute the thread https://github.com/notifications/unsubscribe-auth/AE8cDCo_crK7prin2Q6Uar_CV32w6XEnks5rHp2ngaJpZM4LJ_vq .

awcullen commented 7 years ago

Is this Unity ? I'm curious which platform are you testing. Would you try the latest package version 1.5. I have added support for MonoAndroid. FYI there are changes to the api regarding certificates. Now you construct a DirectoryStore with a path to a writable directory. On first run, a certificate and private key is stored.

The samples here demonstrate this new feature.

mikakaraila commented 7 years ago

Send me private email to mika.karaila@gmail.com then I can give some more details...

On Tue, Dec 13, 2016 at 5:28 PM, Andrew Cullen notifications@github.com wrote:

Is this Unity ? I'm curious which platform are you testing. Would you try the latest package version 1.5. I have added support for MonoAndroid. FYI there are changes to the api regarding certificates. Now you construct a DirectoryStore with a path to a writable directory. On first run, a certificate and private key is stored.

The samples here demonstrate this new feature.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/convertersystems/opc-ua-samples/issues/3#issuecomment-266768360, or mute the thread https://github.com/notifications/unsubscribe-auth/AE8cDGqY7nU7UCQF56kGVY7gsUPKN8l-ks5rHrmVgaJpZM4LJ_vq .

mikakaraila commented 7 years ago

I think this line is now that I should debug: new DirectoryStore(Environment.ExpandEnvironmentVariables(@"%LOCALAPPDATA%\Workstation.ConsoleApp\pki")),

Most probably my device do not have it or cannot create it...