Winsock With HTTPS
How do u use winsock with https? At the moment, my application works with HTTP.
Many thanks to all.
Edited by - Esupofo on 10/17/2002 9:55:40 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Winsock And HTTPS
So my first question. I downloaded some code using the winsock api and it looks like theres a tag in it to flag SSL/HTTPS protocol. Am I incorrect with this and why isn't that flag in the winsock control?
My main question is I'm trying to put together the HTTPS header and I'm not having any luck it keeps dropping the connection imeeadiatly and I'm assuming its because I don't have the header formatted properly.
Is there any examples of a valid https request and header someone can point me to?
I'm currently trying to follow the rfc and its a little confusing.
HTTPS And Winsock
Is there any way to make a POST work over https via winsock?
I can do it very easily if Im just using standard HTTP
but I can't do it using HTTPS and the winsock control.
I mean i set it up to use port 443 and everything but I just get 403 errors.
SSL / Https With Winsock- Know How?
How do I download a web page at an https:// address with Winsock? I have the winsock control in my app and I try the sending GET + the URL. But the server says I'm using the wrong command. I also tried an ActiveX (PowerTCP) to do this, but I need something asynchronous (it's not), so I can have multiple connections at once.
Accessing HTTPS With Winsock.
I know it's possible, but I cannot seem to work it out. I know that I need to grab the site's security certificate and use that to decrypt the webpage, but I have not found anyone who knows how to to do this.
Anyone?
HTTPS Proxy In WinSock Control?
Hi
Is there a way to use a https proxy with the MS winsock control? I have been searching these forums for about 2 days and cannot find anything about it..
Any help is appreciated!!
Also, is there a alternative to the WinSock control with new features/functions in it?
Thanks
Connecting To Https (secure) Sites With Winsock, Possible Or Not?
I'm just starting out with the winsock control and I'm wondering
how I can connect to secure sites. Now when I connect to sites
I just use :
winsock1.connect "www.mysite.net", 80
and specifying http or https in front of the URL does not work.
So will it be difficult for me to connect to secure sites, log in and
retrive data using the winsock control or is it not possible?
If not, what other ways are there to connect to a secure site, log in and retrieve data, without using the rather bulky webbrowser control?
Maybe through API?
HTTPS : Need To Send A Text File To A Server Using HTTPS In VB 6.0 Application
Hi !
I have a VB 6.0 application in which I need to put a text file on the server using HTTPS protocol only.
I downloaded Catalyst File Transfer Control. I am able to get files through the control but cannot put files on server though my program runs without errors.
Any other means by which HTTPS can be used to transfer a text file from a VB 6.0 application to server ?
If somebody could help out !
Thanks,
Tuhina
Https
Ok, I am losing my mind. I did ask this on WinSockVB, but nothing, so I thought I would try here.
I have an application that will need to post data to a website using HTTPS. HTTP was easy, but I am not sure where to start using the winsock control and https. Any thoughts?
Thanks in advance.
Https
I was just curious, do you know what information needs to be sent to HTTPS to gain data retrieval? (winsock)
XML Over HTTPS
Hi!
I'm using VB6 and POsting data to a Java Servlet using XML over HTTPS. I'm able to connect and getting Status code = 200 and readyState = 4 , But I'm not getting any response from the servlet.
Here is my code:
On Error GoTo ErrHandler
Dim oXMLHTTP As New MSXML2.XMLHTTP
Dim sXMLInput As String
Dim sXMLOutPut As MSXML2.DOMDocument
Dim oFS As New Scripting.FileSystemObject
Dim oFile As TextStream
Dim oConn As New ADODB.Connection
Dim sOutPutFile As String
Dim ChkInt As Integer
HTTPPOSTURL = "https://< site address >"
sOutPutFile = App.Path & "OutPutData.xml"
sXMLInput = ""
sXMLInput = "USER=Userid&KEY=Password&PREORDERQRY=< my xml string>
If Trim(sXMLInput) <> "" Then
oXMLHTTP.Open "Post", HTTPPOSTURL, False
oXMLHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
oXMLHTTP.setRequestHeader "contenttype", "multipart/form-data"
oXMLHTTP.setRequestHeader "enctype", "multipart/form-data"
oXMLHTTP.setRequestHeader "postmode", "multipart form"
oXMLHTTP.setRequestHeader "CharSet", "UTF-8"
oXMLHTTP.send sXMLInput
sXMLOutPut = oXMLHTTP.responseXML
Set oFile = oFS.CreateTextFile(sOutPutFile, True)
oFile.Write (sXMLOutPut)
SSL/HTTPS In VB6
I have to download secure information from the web and I don't know where to start. I know I need to implement a client application that uses HTTPS to connect to the specific server.
How do I get my app to support HTTPS connections/SSL v3 connections?
I'm using VB6 and it will probably reside on an NT4 box.
Any help would be appreciated
SSL/HTTPS In VB6
I have to download secure information from the web and I don't know where to start. I know I need to implement a client application that uses HTTPS to connect to the specific server.
How do I get my app to support HTTPS connections/SSL v3 connections?
I'm using VB6 and it will probably reside on an NT4 box.
Any help would be appreciated
Need Help: Download From HTTPS
I have been charged w/ the task of pulling a flat file (.csv) from an HTTPS site and pushing that file to our file share. The web server is hosted by an ASP, thus there is a simple authentication form w/ username and password fields. I need a script that will authenticate itself to the web server, save the file locally and then copy the file to the file share. Here is what I have tried thus far but have not been able to successfully compile. Please look over this code and tell me where I went wrong. My background is mostly VB Script and C++ so I could just be simple syntax problems. Thanks
Private Sub Form_Load()
Dim strCsv As String
Dim oFso As Scripting.FileSystemObject
Dim oTs As Scripting.OpenTextFile
' set the protocol to HTTPS
Inet1.Protocol = icHTTPS
Inet1.Execute myURL, "HEAD", "Authorization: Basic " & myUID & ":" & myPWD
' get the file as a string from the https web server
strCsv = Inet1.OpenURL("https://www.wherethefileis.com)", icString)
Set oFso = New Scripting.FileSystemObject
Set oTs = oFso.OpenTextFile("\uncshare hecsvfile.csv", ForWriting, True)
oTs.Write strCsv
oTs.Close
Unload Me
End Sub
Public Sub FileCopy(sourceFolder As String, destFolder As String)
Dim objFSO As Object, fFolder, fFiles, eFile
Set objFSO = CreatObject("scripting.FileSystemObject")
Set fFolder = objFSO.GetFolder(sourceFolder)
Set fFiles = fFolder.Files
For Each eFile In fFiles
FileCopy eFile, destFolder & "" & eFile.Name
Debug.Print eFile & "copied"
Set fFiles = Nothing
Set fFolder = Nothing
Set objFSO = Nothing
End Sub
Web Folders (https)
can anyone help me
I am creating a program in which it will automatically log into a web folder and then maybe link it to say a dirlistbox or filelistbox or whatever. is that possible?
HTTPS Get/Post
Hi,
Looking for some links/samples about how to Get/Post data with HTTPS.
Thanx in advance.
URLDownloadToFile And HTTPS
I wrote a program that uses the WebBrowser control in order to load and recover some Web pages.
Then I had used the URLDownloadToFile function in order to save these pages on my disc.
This solution was corrected in the past, but now I must recover some pages that use the HTTPS protocol, and when I tried to run my program, the URLDownloadToFile fails.
Someone can tell me why?
Can I use the URLDownloadToFile function with HTTPS protocol?
If no, how can I save my pages without?
Note: I have need to save the pages in invisibile and silent way for the user. He does not have to see the save prompt.
Thanks
Download URL (https:\....)
I know that you can use the INET command to download the html source of a website e.g
Source = Inet1.OpenURL("http://www.yahoo.com")
BUT
this appears not to work for a secured website i.e https://.... Why is this? There is no problem viewing the code with view source from IE, so how come I cant download it. Is there another way perhaps?
Thanks.
Https Headers
How do I view the https headers on a HTTPS page that is controlled by the Webbrowser control. Any help would be appreciated. Thanks!
Help - XML Via HTTPS Fails.
I have searched the forums of the world for the past 3 days and come up with 3 ways to send an XML document using VB6. Every method fails for me that have worked for others.
Please help. Here is the most promising code I have tried:
Sub three()
On Error GoTo eh_3
Dim oXMLHttp As MSXML2.ServerXMLHTTP
Dim oDoc As New MSXML2.DOMDocument30
Set oXMLHttp = New MSXML2.ServerXMLHTTP
If Not oDoc.loadXML("<Message>asdf</Message>") Then Stop
oXMLHttp.open "POST", "https://uat-cld.lasallebank.com/VendorDownloads/AAMGLNB", False
oXMLHttp.setRequestHeader "Content-Type", "text/xml" '"application/x-www-form-urlencoded " '"text/xml"
oXMLHttp.send oDoc 'Line produces error "A connection with the server could not be established"
Set oXMLHttp = Nothing
Debug.Print oXMLHttp.Status & " - " & oXMLHttp.statusText
Stop
eh_3:
Debug.Print oXMLHttp.Status & " - " & oXMLHttp.statusText
Debug.Print Err.Description
Stop
End Sub
Any help appreciated. I am not strong with XML or with setting up environments but have many years with VB.
Will
HTTPS GET/POST Using API
I hate having to include OCX's like MSINET with my projects, because many computers need to register them before being used, which alot of people dont know how to do. Is there any way of using API's to send GET and POST requests to secure websites and get the HTML source back?
Vb6 Https Server
I'm looking for either a way to create an https server ocx control, or find a ready made one open source. I'm writing an open source project that needs a simple secure control panel built into it. I've been searching, but I can't seem to find anything for a server, only clients. is it even possable to do this? or should I settle for standard http or use stdin/stdout to interface with apache or similar? I'd like to keep my app self contained and simple to install without requiring other programs if I can.
Web Folders (https)
can anyone please help me
i am trying to create a program in which it will automatically log into a web folder and then maybe link it to say a dirlistbox or filelistbox or whatever. is that possible? i wanted to check the folder if there are any changes and then download the files automatically
Inet And HTTPS
I am trying to use the Internet Transfer Control (also known as Inet) to get information/download from an HTTPS site with a username/password. I have the protocol set to HTTPS, and I have the username and password properties of the control all filled in correctly. I created the _StateChanged subroutine to see if the state changes. The first time I run the OpenURL method of the control, the state is changed to 1 (The control is looking up the IP address of the specified host computer.) and every subsequent time, the state is 3 (The control is connecting to the host computer.) but it never gets any further than that. I have no idea why this won't connect. At this point I'm wondering if there are any 3rd party controls that I could try to use to connect to the site. Any suggestions would be appriciated.
BTW, here's what I'm trying to do:
There are a bunch of Microsoft Access databases dumped onto a HTTPS server that I am trying to use Visual Basic to download. My application analyzes these databases, and it works fine. Since the data is dumped to the website several times a day, I am trying to automate the downloading of the databases based on which ones the end user needs (there are over 100 databases to choose from) So once the user selects which databases it needs, the application should download these according to their schedule...only I can't even connect to the server at this point.
Mswinsck Https
how would i do this?
for example login into yahoo in secure mode
Private Sub Command1_Click()
Winsock1.Close
Winsock1.Connect "login.yahoo.com", "443"
End Sub
Private Sub Winsock1_Connect()
Dim Packet As String
Packet = "GET /config?login=userpasswd=pass HTTPS/1.1" & vbCrLf
Packet = Packet & "Accept: text/html" & vbCrLf & vbCrLf
Winsock1.SendData Packet
that isn't right, how would i do this?
I get
Bad Request
Your browser sent a request that this server could not understand.
Reason: You're speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please.
Is It Possible To Use Inet With Https?
Can I use Inet to automize something like this:
Entering an https:// website, logging in with a username and password, clicking on links and choosing from dropdown listboxes in the website until I get to the desired page in the website and then downloading a file to which there is a link on that page? Let me emphasize, I'm talking about an https website, and the program should also be able to "surf" automatically inside the website (it should be able to follow links placed on the website's pages, choose from dropdown lists etc.)
If not Inet, is there any other way to do it?
Thanks,
Oded
Need Help With Https And Certificates
Hi. Here is my problem. I hope there is someone who will help me in my problem.
I have to connect to a web server through https protocol. The server gives me a select certificate window to select correct certificate. Then i have to download HTML source file from the given URL.
Can someone give me a code for example?
tnx, Bostjan
HTTPS GET Requests In VB
I'm trying to write a program which requires me to get authentication from a HTTPS server using a GET request. I tried using the Winsock control in VB to connect to the HTTPS server but I never get a response. I'm a novice at making requests to a HTTPS server but I suspect I need something more sophisticated than the Winsock control in order to connect to the HTTPS server.
Any ideas?
HTTPS Connection
I am in urgently need to make a secure connection to https site. (direct, no proxy)
I've used two different ways :
1. Using Inet VB component :
Inet1.UserName = "valid login"
Inet1.Password = "valid password"
Inet1.Protocol = icHTTPS
Text1.Text = Inet1.OpenURL("https://xxx.xxx.com")
2. Using wininet.dll
hOpen = InternetOpen("VB OpenUrl", INTERNET_OPEN_TYPE_PRECONFIG, vbNullString, vbNullString, 0) ' returns valid handle
iConect = InternetConnect(hOpen, "https://xxx.xxx.com", INTERNET_DEFAULT_HTTPS_PORT, "valid login", "valid passwd", INTERNET_SERVICE_HTTP, 0, 0) ' returns 0
In both case it returns Error 401.2
I don't understand it, cause if i use browser, I can easy get in. I've a valid account for this site.
Please help ! I am sitting third day over it yet.
Thanx in forward.
Roman
ICQ#53551457
Ssl/https Using Inet?
I need to connect to a secure https site to execute a script. Can inet do the job or is there anther ActiveX control that will do this. I need to use ssl/https style request or port 443. I see in the properties in inet that you can set the port to 443.
Https Client
Hi
I need a program that can send http/https requests to web servers and save their responses.
I know powertcp web tool(http://www.dart.com) but I have some difficulties using it for https protcol, can u help me in resolving my problem or can u introduce me another tool?
Thanks
Ehsan
HTTP Vs HTTPS Using WinInet.dll
I have set up my VB app to POST some information for me, which is working over HTTP. I am told there are several changes I must make to get the code to work with SSL, however after making those changes, it doesn't work.
Here is a code fragment that demonstrates the changes I have made. I have also been told that when specifing a secure site, you need to use https://www.XXX.com as opposed to www.XXX.com (with no http) for the value of Server in the following code. I have already done that. Notice these changes, depending on whether Secure is set or not.
InternetOpen - no change
InternetConnect - changed from INTERNET_INVALID_PORT_NUMBER to INTERNET_DEFAULT_HTTPS_PORT (also server has https:// in front of it)
HttpOpenRequest - Added INTERNET_FLAG_SECURE flag
HttpSendRequest - no change
Currently, I get an error from HttpSendRequest when operating in secure mode. It returns a Boolean error, and GetLastError returns 0, so there is no useful error message I can get.
Code:
hOpen = InternetOpen("WGHelper.exe", _
INTERNET_OPEN_TYPE_PRECONFIG, "", "", 0)
If hOpen <> 0 Then
If Secure Then
hConnection = InternetConnect(hOpen, Server, INTERNET_DEFAULT_HTTPS_PORT, _
"", "", INTERNET_SERVICE_HTTP, 0, 0)
Else
hConnection = InternetConnect(hOpen, Server, INTERNET_INVALID_PORT_NUMBER, _
"", "", INTERNET_SERVICE_HTTP, 0, 0)
End If
If hConnection <> 0 Then
If Secure Then
hURL = HttpOpenRequest(hConnection, "POST", CGI, "", "", 0, _
INTERNET_FLAG_KEEP_CONNECTION Or INTERNET_FLAG_SECURE, 0)
Else
hURL = HttpOpenRequest(hConnection, "POST", CGI, "", "", 0, _
INTERNET_FLAG_KEEP_CONNECTION, 0)
End If
If hURL <> 0 Then
If HttpSendRequest(hURL, "", 0, _
postBuffer, Len(postBuffer)) Then
VB6 And Posting To A Https Site With PHP
Hello all new viewer here,
I've been searching through about a hundered websites and I can't seem to find the answer to my problem.
I have a program which posts information to a PHP form. That form then posts it to mySQL server that I have. This works fine when I'm connecting to a standard http session. However I now need to place this on my secure server. I can't seem to find any solutions where posting to https:\ will work.
The following code works to post to the unsecure site...
Public Sub Post2(URL As String, FieldNames() As String, FieldValues() As String)
Dim PostData As String
Dim i As Integer
PostData = ""
For i = LBound(FieldNames) To UBound(FieldNames)
If PostData <> "" Then PostData = PostData & "&"
PostData = PostData & FieldNames(i) & "=" & FieldValues(i)
Next
Me.Inet2.Execute URL, "POST", PostData, "Content-Type:application/x-www-form-urlencoded"
End Sub
Just changing the inet control to use https is not enough for this... any help would be much appricated.
Files Under Https Folder
i'm downloading files manually using IE in a https:// server. i want to view all the files in a https:// server using vb6 and download any from the files.
i'm familiar with Microsoft Internet Transfer control, my problem is i want to view the files first before downloading them. how to do it?
Tamps
Code To Set Protocol To HTTPS???????
I need to set the inet protocol to HTTPS
this is how I tried to do it, but I am getting a compile error:
Inet1.Protocol = icHTTPS
Please help....
Inet1.Execute myURL, "HEAD", "Authorization: Basic " & myUID & ":" & myPWD
Visual Basic 6 And HTTPS
Hello my friends!
How can I connect my VB6 program with a HTTPS website? I am new in VB world and I need this. I need to conect using a user and password and after I need to upload one file to the server.
Thanks for the help.
WebBroser1.navigate(“https:…”) In VB 6.0?
Need help in sending SMS from VB 6.0.
We use an external service for this, so we only need to send a https: string with url , username, password and message to be sent.
I tried it from VB 2008 and it was working find, but there I used the WebBroser1.navigate(“https:…”)
It is also returning an error or status code that will be displayed in the WebBrowser1.
The problem is that we are using VB 6.0 where this application will be used, so I wonder how to implement it in VB 6.0
The only code fragment I found was this ( But it was not for VB 6.0):
Set xmlhttp = new ActiveXObject("Microsoft.XMLHTTP")
xmlhttp.Open("GET", "https://keyte.. ", false)
Display.innerHTML=xmlhttp.responseText
Any help on what component to use will be fine. I got the professional version of VB 6.0.
Connecting Via HTTPS Protocol
Can someone help me with this? I've read like every thread containing https and got nowhere.
Either with winsock or inet, (not webbrowser).
Thanks.
Send XML File To Https URL
Hi
I'm trying to send a XML string to a partner HTTPS URL. I'm using VB6.0
When I try to do this, I get an error saying "A certificate is required to complete client authentication". The certificate is installed in the server. how do i invoke the certificate common name in the code.
Call xmlHTTP.Open("POST", SiteURL, False)
xmlHTTP.setOption(3) = ????? what should be the value here.
xmlHTTP.send (psXML)
I would appreciate if anyone can help me in this regard ASAP.
Thanks
KV
HTTP Vs HTTPS Using WinInet.dll
I have set up my VB app to POST some information for me, which is working over HTTP. I am told there are several changes I must make to get the code to work with SSL, however after making those changes, it doesn't work.
Here is a code fragment that demonstrates the changes I have made. I have also been told that when specifing a secure site, you need to use https://www.XXX.com as opposed to www.XXX.com (with no http) for the value of Server in the following code. I have already done that. Notice these changes, depending on whether Secure is set or not.
InternetOpen - no change
InternetConnect - changed from INTERNET_INVALID_PORT_NUMBER to INTERNET_DEFAULT_HTTPS_PORT (also server has https:// in front of it)
HttpOpenRequest - Added INTERNET_FLAG_SECURE flag
HttpSendRequest - no change
Currently, I get an error from HttpSendRequest when operating in secure mode. It returns a Boolean error, and GetLastError returns 0, so there is no useful error message I can get.
VB Code:
hOpen = InternetOpen("WGHelper.exe", _ INTERNET_OPEN_TYPE_PRECONFIG, "", "", 0) If hOpen <> 0 Then If Secure Then hConnection = InternetConnect(hOpen, Server, INTERNET_DEFAULT_HTTPS_PORT, _ "", "", INTERNET_SERVICE_HTTP, 0, 0) Else hConnection = InternetConnect(hOpen, Server, INTERNET_INVALID_PORT_NUMBER, _ "", "", INTERNET_SERVICE_HTTP, 0, 0) End If If hConnection <> 0 Then If Secure Then hURL = HttpOpenRequest(hConnection, "POST", CGI, "", "", 0, _ INTERNET_FLAG_KEEP_CONNECTION Or INTERNET_FLAG_SECURE, 0) Else hURL = HttpOpenRequest(hConnection, "POST", CGI, "", "", 0, _ INTERNET_FLAG_KEEP_CONNECTION, 0) End If If hURL <> 0 Then If HttpSendRequest(hURL, "", 0, _ postBuffer, Len(postBuffer)) Then
Help With Robust HTTPS Download
I have a program that retrieves data from a page that uses HTTPS.
I previously used URLDownloadToFile function which is easy to use.
The problem is when there is a unstable internet connection (like it is in China where I stay at the moment) the function gets stuck around 50% of the time. I guess this is a problem in IE. The same thing happens in a normal IE browser, Firefox works fine.
So I found an excellent code from Eduardo A. Morcillo, (http://www.mvps.org/emorcillo) which works fine also in bad conditions. The problem is when I'm using a software firewall it also get stuck around 20% of the time.
Does anyone have experience of this problem? I really don't want to spend too much time going into the HTTP protocols...
Solution: HTTP & HTTPS
Hello everybody,
Here is a simple code that makes HTTP and HTTPs requests to URLs. As you can see the code is simple and uses the msxml.dll (Microsoft XML version 2) that comes with the IE 5. If you want to reload the URL again then set "Every visit" to the settings of IE.
Enjoy it!!!
Private Function MakeHTTPCall(theURL As String) As String
Dim xmlhttp As New MSXML.XMLHTTPRequest
On Error GoTo errorHandler
Call xmlhttp.Open("GET", theURL, False)
Call xmlhttp.send
MakeHTTPCall = xmlhttp.responseText
errorHandler:
If Err.Number <> 0 Then _
MakeHTTPCall = ""
End Function
Hope it helps!!!
vvang10
Retrieve Data Under HTTPs...
Hello everybody.
I am working with VB6 and I am using the MSINET component to get a response from a URL. With something like that I get a response for a HTTP URL:
tmp = Inet1.OpenURL(theURL)
where theURL contains the URL plus the username and passowrd encrypted.
The server, on the other side, is been implemented to response with a XML string which is stored in the tmp variable.
But for a HTTPs URL I can not get any response. Is there any simple way that I can have the XML string for HHTPs by using the MSINET component?
Thanx in advance.
vvang10
Automating Https Sessions
I'm interested in a program that will automatically log in to an https web site, with a supplied user name and password. Once in, the program will automatically go to specific pages in the secure site, and then download specific data files. Where can I get something like this? I don't mind if it's a DLL -- I can use it in a VB program to make use of the functionality.
THANKS!
SOAP, XMLHTTP And HTTPS
Hi,
I hope there are not too many acronyms
I have to call a web service, and I have to do it with SOAP.
I have looked a couple of examples that seem to work, and they use the XMLHTTP object (Microsoft XML), so you construct the SOAP message and thought XMLHTTP object will be send to the server, and then you get back the answer.
So far so good.
My question is, Can you use also the XMLHTTP object with HTTPS (so with SSL)? Anybody uses XMLHTTP with SSL?
This is an important question, because if not, I have to use something else to get to the webservice.
If so, which medium have you used?
Thanks for your time.
Jaime
|