Generating Certificates

Questions regarding the use of the .NET SDK 2.0 for Server or Client development or integration into customer products ...

Moderator: uasdknet

Post Reply
JonLor
Hero Member
Hero Member
Posts: 48
Joined: 30 Jan 2014, 11:05

Generating Certificates

Post by JonLor »

Hello,

I am trying figure out how to use certificates by setting up a server and client application from scratch. I have setup the server application with paths etc. for certificate locations in the configuration file. When starting the server for the first time, no certificate exist yet so I have written code to generate it. This succeeds and a certificate is created in the expected paths. However, when restarting the application the certificate is not found and a new certificate is generated instead.

I'm having trouble debugging what the cause of this behavior is: I suspect there is a mismatch in the certificate configuration and creation parameters but I have not found a mismatch.

Do you have any advise?

This is a section from the log file
09:24:28.459|0009|00|0|Log created.
09:24:28.460|0009|00|0|Entry Assembly: Server, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
09:24:28.460|0009|00|0|Stack Assembly: Server, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
09:24:28.461|0009|01|0|MODULE LOADED [1] UnifiedAutomation.Stack
09:24:28.461|0009|02|0|MODULE LOADED [2] UnifiedAutomation.Server
09:24:28.462|0009|00|0|***TRIAL***.NET OPC UA Server SDK 1.0.0 (BETA) - Generic Evaulation License -
09:24:28.463|0009|01|2|Loaded application settings from app.config.
09:24:28.465|0009|01|4|Processing Command Line: {C:\Temp\WpfApplication20\Server\bin\Debug\Server.vshost.exe}
09:24:28.466|0009|01|5|=> ApplicationInstance.Start
09:24:28.473|0009|01|5|=> Application.CheckConfiguration
09:24:37.220|0009|01|5|=> CertificateFactory.CreateCertificate
09:24:37.238|0009|01|8|CreateCertificate {
09:24:37.241|0009|01|8|StorePath=c:\Certificates\own
09:24:37.242|0009|01|8|ApplicationName=TerraServer
09:24:37.243|0009|01|8|SubjectName=CN=TerraServer/O=ABC/DC=localhost
09:24:37.243|0009|01|8|ApplicationUri=urn:localhost:ABC:TerraServer
09:24:37.244|0009|01|8|DomainNames={SEVST-L-0007441}
09:24:37.244|0009|01|8|KeySize=1024
09:24:37.245|0009|01|8|StartTime=0001-01-01 00:00:00
09:24:37.246|0009|01|8|LifetimeInMonths=240
09:24:37.246|0009|01|8|HashSizeInBits=0
09:24:37.247|0009|01|8|IsCA=False
09:24:37.247|0009|01|8|UsePEMFormat=False
09:24:37.248|0009|01|8|IssuerKeyFilePath=
09:24:37.248|0009|01|8|}
09:24:39.266|0009|01|8|Thumbprint=75ACAA739B9C177B4EE6555AB56A3C939FABE948
09:24:39.309|0009|01|5|<= CertificateFactory.CreateCertificate
09:24:39.310|0009|01|4|Certificate Assigned: CN=TerraServer, O=ABC, DC=localhost
09:24:39.316|0009|01|1|ERROR: Overriding ApplicationUri (urn:sevst-l-0007441:ABC:TerraServer) with URI from ApplicationCertificate (urn:localhost:ABC:TerraServer).
09:24:39.348|0009|01|4|Added Endpoint (SignAndEncrypt): opc.tcp://sevst-l-0007441:48030/ [SignAndEncrypt:Basic256:Binary]
09:24:39.350|0009|01|4|Added Endpoint (SignAndEncrypt): opc.tcp://sevst-l-0007441:48030/ [SignAndEncrypt:Basic128Rsa15:Binary]
09:24:39.352|0009|01|4|Added Endpoint (None): opc.tcp://sevst-l-0007441:48030/ [None:None:Binary]
09:24:39.353|0009|01|5|<= Application.CheckConfiguration
09:24:39.393|0009|02|4|Overridding RegistrationInterval Setting with minimum of 30.
09:24:39.415|0009|02|4|Overridding MaxRequestAge Setting with the minimum of 60000ms
Best regards
Jonas

User avatar
Support Team
Hero Member
Hero Member
Posts: 3072
Joined: 18 Mar 2011, 15:09

Re: Generating Certificates

Post by Support Team »

Hello,

Is the SubjectName used for creating the certificate the same than SubjectName specified in the application settings?

Best regards
Support Team

JonLor
Hero Member
Hero Member
Posts: 48
Joined: 30 Jan 2014, 11:05

Re: Generating Certificates

Post by JonLor »

Hello,

Yes.

/Jonas

User avatar
Support Team
Hero Member
Hero Member
Posts: 3072
Joined: 18 Mar 2011, 15:09

Re: Generating Certificates

Post by Support Team »

Hello,

could you please send the code, which should generate the certificate to support@unifiedautomation.com?

Best regards
Support Team

Post Reply