SSL Examples

Using SSL is as simple as entering "https://www.someserver.com/" as Url for Retrieve or Save. However, the component also supports two more interesting properties when dealing with certificate problems.

Simple SSL Example (simplessl.asp)

<%  @LANGUAGE=VBSCRIPT %>
<%  Option Explicit %>
<!-- #include file="asptearinclude.asp" -->

<html>
<head>
   <title>Simple SSL</title>
</head>

<body bgcolor=#ffffff>

<%
Dim xObj, strResult, bErrors

' create the object
Set xobj = CreateObject("SOFTWING.ASPtear")

On Error Resume Next

' do a simple SSL get (assumes CA is known, and CN is OK)
strResult = xobj.Retrieve("https://www.zauner.at/", Request_GET, "", "", "")
bErrors = HandleError()

If Not bErrors Then
   Response.Write "SSL document was retrieved successfully!"
End If
%>


</body>
</html>

Advanced SSL Example (advancedssl.asp)

<%  @LANGUAGE=VBSCRIPT %>
<%  Option Explicit %>
<!-- #include file="asptearinclude.asp" -->

<html>
<head>
   <title>Advanced SSL Example</title>
</head>

<body bgcolor=#ffffff>

<%
Dim xObj, strResult, bErrors

' create the object
Set xObj = CreateObject("SOFTWING.ASPtear")

On Error Resume Next

xObj.TrustUnknownCA = True
xObj.IgnoreInvalidCN = True

' force an invalid CN by simply entering the IP address of www.zauner.at
strResult = xObj.Retrieve("https://209.143.139.197/", Request_GET, "", "", "")
bErrors = HandleError()

If Not bErrors Then
   Response.Write "SSL document was retrieved successfully!"
End If
%>


</body>
</html>