Link to home
Start Free TrialLog in
Avatar of ryoga75
ryoga75

asked on

Capture a web page under HTTPS via ASP

Hi everybody.

i have a big problems.
I need to capture all the contents of a web page under the https protocol.
Someone have an idea on how i can do it?

I'm trying to do it via XMLHTTP but everytime i got an Permission Denied error.
All ideas are accepted ( i need a good one that work :) )
Thanks
Avatar of justinbillig
justinbillig

Well I found two things that might help you,

Check out this link

There is some code that will automatically accept cert's
http://weblogs.asp.net/jan/archive/2003/12/04/41154.aspx


or possibly this link


"For security reasons, there are some limits to where you can get data using
XMLHTTPRequest. The "Access data sources across domains" setting in Tools,
Internet Options, Security controls the behavior.
http://msdn.microsoft.com/library/d...entsecurity.asp"

http://www.codecomments.com/JScript/message447397.html

ok try this, https needs to pass certificate to the website

<%
const SXH_OPTION_SELECT_CLIENT_SSL_CERT=3
const certname=""  ' certname when left blank pulls your first client certificate

Set objXmlHTTP = Server.CreateObject("Msxml2.ServerXMLHTTP.4.0")
objXMLhttp.SetOption(SXH_OPTION_SELECT_CLIENT_SSL_CERT, certname)
objXmlHTTP.Open("GET", "https://www.sitename.com", false)
objXmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
objXmlHttp.Send()

Response.Write(objXmlHttp.responseText)
%>
ASKER CERTIFIED SOLUTION
Avatar of davidlars99
davidlars99
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hai,

We used XMLHTTP long time back and we had many problems with this like firewall blocking, HTTPS problems and so on... Now we are using 3rd pary component called ASPTear which is doing it's work nicely. If you want to use it commercialy you can purchase or else you can use their free version. They had given full examples to use on ASP.

Check this link.
http://www.alphasierrapapa.com/IisDev/Components/AspTear/

Bye
Ajai
@ We used XMLHTTP long time back and we had many problems with this like firewall blocking....

maybe those issues were known in older versions of xmlhttp, in msxml 4.0 all these bugs have been eliminated and you don't have to worry about those issues anymore  :)
Avatar of ryoga75

ASKER

@davidlars99 : i'ved installed the Msxml2.ServerXMLHTTP.4.0, i tried your code, and now i have an "Access denied" error.
(before was a permission denied ).
I think that it's a problems of "user" and "password" that are required, but i don't know how can i send that info.
May you help me?

@ajaikumarr : i'll try your solution shortly, luckly i'll have the possibility to install the component on my pc :)
Avatar of ryoga75

ASKER

At the end i reached to do what i wanted with the help of the Msxml2.ServerXMLHTTP.3.0
If @davidlars99 know and wanna let me know why with version 4.0 i retrieve an "Access Denied" ( or how to solve it ), would be good :)  ( no problem if he don't know or he can't :) )

For the AspTear component, i tried but i got always the same error " certificate don't meet the origin site " (or something like this ).
Thanks for your help both.
@> and wanna let me know why with version 4.0 i retrieve an "Access Denied"....

might be 2 things:

1. it is not installed and you need first download it from here
http://www.microsoft.com/downloads/details.aspx?FamilyID=3144b72b-b4f2-46da-b4b6-c5d7485f2b42&DisplayLang=en

2. you may want to send the login information (as you asked) thru the request like so
objXmlHTTP.Open("GET", "https://www.sitename.com", false, "username", password")