title: Classic ASP Outbound TLS 1.2
body: <p>We use a web API call to UPS to check address information.  They are requiring TLS 1.2 and the switch has broken our page.  </p>
  
  <pre><code>&lt;%
  
  If ACTION="Verify" and ncSCountry="USA" and ncSState&lt;&gt;"PR" and ncSState&lt;&gt;"AA" and ncSState&lt;&gt;"AP" and ncSState&lt;&gt;"AE" then
  
      Dim sXML 
  
      sXML = "&lt;?xml version='1.0'?&gt;"
      sXML = sXML &amp; "&lt;AccessRequest xml:lang='en-US'&gt;"
      sXML = sXML &amp; "&lt;AccessLicenseNumber&gt;XXXXXX&lt;/AccessLicenseNumber&gt;"
      sXML = sXML &amp; "&lt;UserId&gt;XXXX&lt;/UserId&gt;"
      sXML = sXML &amp; "&lt;Password&gt;XXXX&lt;/Password&gt;"
      sXML = sXML &amp; "&lt;/AccessRequest&gt;"
      sXML = sXML &amp; "&lt;?xml version='1.0'?&gt;"
      sXML = sXML &amp; "&lt;AddressValidationRequest xml:lang='en-US'&gt;"
      sXML = sXML &amp; "&lt;Request&gt;"
      sXML = sXML &amp; "&lt;TransactionReference&gt;"
      sXML = sXML &amp; "&lt;CustomerContext /&gt;&lt;XpciVersion&gt;1.0001&lt;/XpciVersion&gt;"
      sXML = sXML &amp; "&lt;/TransactionReference&gt;"
      sXML = sXML &amp; "&lt;RequestAction&gt;XAV&lt;/RequestAction&gt;"
      sXML = sXML &amp; "&lt;RequestOption&gt;1&lt;/RequestOption&gt;&lt;/Request&gt;"
      sXML = sXML &amp; "&lt;MaximumListSize&gt;1&lt;/MaximumListSize&gt;"
      sXML = sXML &amp; "&lt;AddressKeyFormat&gt;"
      sXML = sXML &amp; "&lt;ConsigneeName&gt;&lt;/ConsigneeName&gt;"
      sXML = sXML &amp; "&lt;BuildingName&gt;&lt;/BuildingName&gt;"
      sXML = sXML &amp; "&lt;AddressLine&gt;" &amp; ncSAddr1   &amp; "&lt;/AddressLine&gt;"
      sXML = sXML &amp; "&lt;AddressLine&gt;" &amp; ncSAddr2   &amp; "&lt;/AddressLine&gt;"
      sXML = sXML &amp; "&lt;AddressLine&gt;&lt;/AddressLine&gt;"
      sXML = sXML &amp; "&lt;PoliticalDivision2&gt;" &amp; ncSCity &amp; "&lt;/PoliticalDivision2&gt;"
      sXML = sXML &amp; "&lt;PoliticalDivision1&gt;" &amp; ncSState &amp; "&lt;/PoliticalDivision1&gt;"
      sXML = sXML &amp; "&lt;PostcodePrimaryLow&gt;" &amp;  ncSZip   &amp; "&lt;/PostcodePrimaryLow&gt;"
      sXML = sXML &amp; "&lt;CountryCode&gt;US&lt;/CountryCode&gt;"
      sXML = sXML &amp; "&lt;/AddressKeyFormat&gt;"
      sXML = sXML &amp; "&lt;/AddressValidationRequest&gt;"
  
  
      'Now pass the request to UPS
      Dim xmlhttp4, sResponseXML, myDoc
      Set xmlhttp4 = CreateObject("WinHttp.WinHttpRequest.5.1")
      'Set xmlhttp4 = CreateObject("MSXML2.ServerXMLHTTP")
      xmlhttp4.Open "POST","https://onlinetools.ups.com/ups.app/xml/XAV", false
      xmlhttp4.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
      xmlhttp4.send(sXML)
      If xmlhttp4.Status &gt;= 400 And xmlhttp4.Status &lt;= 599 Then
          'Response.Write( "Error Occurred : " &amp; xmlhttp.Status &amp; " - " &amp; xmlhttp.statusText)
          sResponseXML = "&lt;/empty&gt;"
      Else
          sResponseXML = xmlhttp4.responseText
      End If
  
      Set myDoc=CreateObject("Microsoft.XMLDOM")
      myDoc.loadXML(sResponseXML)
      myDoc.async = false
  
      Dim addressline, addressline2, city, state, zip, zip4, responsestatus
  
      Dim root, NodeList, x
      Set root = myDoc.DocumentElement
      If myDoc.hasChildNodes then 
          Set NodeList = root.SelectNodes("AddressKeyFormat")
          For x = 0 To (NodeList.Length - 1)
              city = NodeList.Item(x).SelectSingleNode("PoliticalDivision2").Text
              state = NodeList.Item(x).SelectSingleNode("PoliticalDivision1").Text
              addressline = NodeList.Item(x).SelectSingleNode("AddressLine").Text
  
              addressline2=NodeList.Item(x).SelectSingleNode("AddressLine").NextSibling.nodename
              if addressline2="AddressLine" then
                  addressline2=NodeList.Item(x).SelectSingleNode("AddressLine").NextSibling.Text
              Else
                  addressline2=""
              ENd if
  
              zip = NodeList.Item(x).SelectSingleNode("PostcodePrimaryLow").Text
              zip4 = NodeList.Item(x).SelectSingleNode("PostcodeExtendedLow").Text
          Next
      End If
  
      Dim startcust3, endcust3
      startcust3=instr(sresponseXML, "&lt;ResponseStatusCode&gt;")
      endcust3 = instr(sresponseXML, "&lt;/ResponseStatusCode&gt;")
      responsestatus=Mid(sResponseXML,startcust3+20,(endcust3-startcust3-20))
  
  ENd if
  
  
  %&gt;
  </code></pre>
  
  <p>I have already tried to make this switch, but I feel like I am missing something.</p>
  
  <pre><code>Set xmlhttp4 = CreateObject("WinHttp.WinHttpRequest.5.1")
  'Set xmlhttp4 = CreateObject("MSXML2.ServerXMLHTTP")
  </code></pre>