![Avatar](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/userdefault.png)
01/07/2022
![sp_UserOfflineSmall](https://opcfoundation.org/wp-content/sp-resources/forum-themes/reboot/images/darkpack/sp_UserOfflineSmall.png)
Hi,
I have developed OPC UA SERVER application using CSharp(C#) language.
OPC UA SERVER SDK used in the current solution is 1.4.366.0 which is having an auto generation of self-signed certificates during the server startup.
So currently I am looking into different options on how to load my own certificate.? (I have created certificate by XCA TOOL) from the configuration instead of auto generation.
<ApplicationCertificate>
<StoreType>Directory</StoreType>
<StorePath>%CommonApplicationData%\OPC Foundation\pki\own</StorePath>
<SubjectName>CN=OPCUASERVER,OU=Als,O=Als1,C=IN</SubjectName>
</ApplicationCertificate>
I am using following code
![Avatar](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/admindefault.png)
05/30/2017
![sp_UserOfflineSmall](https://opcfoundation.org/wp-content/sp-resources/forum-themes/reboot/images/darkpack/sp_UserOfflineSmall.png)
If you create your own certificate you need to copy it to the folder specified by the ApplicationCertificate element in configuration and ensure the SubjectName or Thumbprint exactly matches your certificate.
Note the SDK uses this directory layout for certificate stores:
![Avatar](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/userdefault.png)
01/07/2022
![sp_UserOfflineSmall](https://opcfoundation.org/wp-content/sp-resources/forum-themes/reboot/images/darkpack/sp_UserOfflineSmall.png)
Hi, thanks for your reply. I have tried with my own certificate and placed under--> %CommonApplicationData%\OPC Foundation\pki\own\certs path.
My own certificate file which is generated by XCA tool ---->OPCUASERVER.cer. I have configured subject name details in config file
CN=OPCUASERVER, OU=Als, C=IN
<SubjectName>CN=OPCUASERVER, OU=Als, C=IN</SubjectName>
but I am getting following error when OPC UA server application calls following method,
application.DisableCertificateAutoCreation = true; (disable auto certificate creation make it as true)
bool haveAppCertificate = await application.CheckApplicationInstanceCertificate(false, 0);
One or more errors occurred. (There is no cert with subject CN=OPCUASERVER, OU=Als, C=IN in the configuration.Please generate a cert for your application,then copy the new cert to this location:%CommonApplicationData%\OPC Foundation\pki\own)
1 Guest(s)