user1012506
user1012506

Reputation: 2118

Same x509certificate in server and client

I have the same certificate (use x509certificate2) in the application and in the server (both in C#),

I have to extend the validity of the certificate file in the server,

I use in SSL3 with the certificate to connect to soap web service from client (with set or get)

My question Is it mandatory for the same certificate to be in the app?

  try
        {
            // Initiate a new request to the WS

            System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls;

            MyServiceSSL.MyWebServiceClient clClient = new MyServiceSSL.MyWebServiceClient();

            clClient.Endpoint.Address = new System.ServiceModel.EndpointAddress(sConnStr);

            ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(ValidateRemoteCertificate);

            try
            {
                clClient.ClientCredentials.ClientCertificate.SetCertificate(
    StoreLocation.LocalMachine,
    StoreName.TrustedPeople,
    X509FindType.FindBySubjectName,
    "myDomain.com");
            }
            catch (Exception e)
            {
              ...
            }

             MyServiceSSL.myDataRequest clRequest = new MyServiceSSL.myDataRequest();

            // Set up request parameters
            clRequest = new myDataRequest();

            clResult = clClient.myFunc(clRequest.MyRequest_1);

Upvotes: 0

Views: 91

Answers (1)

Daniel Fisher  lennybacon
Daniel Fisher lennybacon

Reputation: 4184

I have to extend the validity of the certificate file in the server,

Does that mean the validity date? If so, of course you need to renew both otherwise one would be expired and therefore not valid any more.

BTW: You should not use SSL3

Upvotes: 1

Related Questions