MSXML2.XMLHTTP30 & Client Certificates

amhoff

New Member
Joined
Jun 13, 2016
Messages
2
Hello all,
I'm working with MSXML2.XMLHTTP to iterate through a list of URLs to determine if they're still valid sites.

Here's the catch: many of these sites require client-side certificate login at the root of the URL. I want to be able to determine if the site requires the cert login, not attempt to login, then return a status saying as such. What I've got now iterates through each URL and returns the status code and it works well, but each time it hits a site requiring client certificate login, it pops up the certificate chooser. This is not feasible with over 500 sites to check on a regular basis.

In short, if the URL asks for client certificate, let me know and go on to the next URL without user interaction. Is this possible?

Thanks for all the help!

Here's what I have now:
Code:
Sub CheckHyperlinks()

    Dim oColumn As Range
    Set oColumn = ActiveWorkbook.Worksheets(1).Range("B:B")

    Dim oCell As Range
    For Each oCell In oColumn.Cells

        If oCell.Hyperlinks.Count > 0 Then

            Dim oHyperlink As Hyperlink
            Set oHyperlink = oCell.Hyperlinks(1) ' I assume only 1 hyperlink per cell
            
            Dim strResult As String
            strResult = GetResult(oHyperlink.Address)
    
            oCell.Offset(0, 4).Value = strResult

        End If

    Next oCell
End Sub

Private Function GetResult(ByVal strUrl As String) As String

    On Error GoTo ErrorHandler

    Dim oHttp As New MSXML2.XMLHTTP30
    oHttp.Open "HEAD", strUrl, False
    oHttp.send

    GetResult = oHttp.Status & " " & oHttp.statusText

    Exit Function

ErrorHandler:
    GetResult = "Error: " & Err.Description

End Function
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

Forum statistics

Threads
1,216,117
Messages
6,128,937
Members
449,480
Latest member
yesitisasport

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top