MSXML2.ServerXMLHTTP.6.0 + Client Certificate problem RRS feed

  • Question

  • i have create one very important Excel application (VBA) that retrieves information from remote system. however this remote system requires that the user has appropriate client certificate installed (in below list Certificate 2).

    I have following client certificates in my system.

    Client certificate 1

    subject: { CN = loginname }

    Client certificate 2 <---- THIS IS THE CERTIFICATE I WANT TO SELECT

    subject {

    0.9.2342.19200392.100.1.1 = loginname

    O = companyname

    CN = loginname }

    Client certificate 3

    subject: { CN = loginname@companyname }

    Now, I am using Set Http = CreateObject("MSXML2.ServerXMLHTTP.6.0") to create a HTTPS-request and use Http.setOption(3) = "companyname" to select appropriate client certificate to use with my request.

    Everything works perfectly if I only have Certificates 1 and 2 installed. But, if I have certificate 3 installed as well my request doesn't work anymore. Somehow the "companyname" that I am using to distinguish which certificate to select confuses if certificate 3 is there.

    I cannot find any other information (except Subject) that could be used to identify the correct certificate. No friendly name. The problem is that those subjects are very similar between certificates.

    My questions:

    How is this setoption implemented? Does it work only with subject or something else as well?

    Am I missing something? I would have though that every certificate should have something unique that could be used to distinguish between them.

    I appreciate any help with this, as I have been fighting with this for weeks now.

    Sunday, April 26, 2015 4:14 PM

All replies

  • Hi hillrainbow,

    Thanks for posting in MSDN fourm.

    This forum is for developers discussing developing issues in volve Excel applicaiton like Excel automation, customization and etc.

    Since this issue is more relative to VBA, I would move it to VBA forum.

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.

    Thanks for your understanding.

    Regards & Fei

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, April 27, 2015 2:49 AM
  • Hi Fei,

    Thanks for helping and moving this to the right forum.

    Anyone experienced around the original question and/or having inside knowledge how setoption-method works?



    Tuesday, May 5, 2015 8:56 AM
  • Try lower control

    Dim xmlHttp2 As New MSXML2.ServerXMLHTTP
    Set xmlHttp2 = CreateObject("Msxml2.ServerXMLHTTP")

    Or use  use late late binding. Then Excel find control by them self

    Oskar Shon, Office System MVP -
    if Helpful; Answer when a problem solved

    Friday, May 8, 2015 3:27 PM