• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 258
  • Last Modified:

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
0
ryoga75
Asked:
ryoga75
1 Solution
 
justinbilligCommented:
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

0
 
davidlars99Commented:
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)
%>
0
 
davidlars99Commented:
> Set objXmlHTTP = Server.CreateObject("Msxml2.ServerXMLHTTP.4.0")

this requires xml 4.0 to be installed on the server, if you don't have it I suggest to install it

http://www.microsoft.com/downloads/details.aspx?FamilyID=3144b72b-b4f2-46da-b4b6-c5d7485f2b42&DisplayLang=en

if you can't install it then change it to

Set objXmlHTTP = Server.CreateObject("Msxml2.ServerXMLHTTP.3.0")

not sure though  :)
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
ajaikumarrCommented:
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
0
 
davidlars99Commented:
@ 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  :)
0
 
ryoga75Author Commented:
@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 :)
0
 
ryoga75Author Commented:
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.
0
 
davidlars99Commented:
@> 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")
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now