views:

538

answers:

2

The Problem: I am creating a vb6 application that will connect to a particular web service located on a a HTTPS site. The problem is, the HTTPS site I'm accessing requires all request to accept it's certificate policy. (as its a self-signed ssl certificate)

Basically I need the application to accept security certificate dialog boxes automatically. A sample security dialog is shown below:

Cheers in advance.

@EDIT:

I Cant' post an image yet as i am a new user... Please see the url below for a sample image:

http://oit.nd.edu/network/nomad/images/ie%5Fcerts.gif

A: 

Look for a property named Silent.

You will have to catch some other event, to reply to that dialog box. Although, I am not sure what is the behavior, if you set the Silent to true (i.e does it assume it to be Yes or otherwise?).

shahkalpesh
Setting it to silent hides the message box, but assumes the user clicks no -- resulting in a internal "Navigation to the webpage was canceled" page...
neddy
Do you know of any public website, where I can simulate this behviour?
shahkalpesh
https://fleximail.flexinet.com.au/is a website that has the message.
neddy
A: 

Most of HTTPS sites I know use self-signed certificates.

I don't know VB6 APIs for HTTPS, but for example in Java you should provide it a copy of the site certificate beforehand. That is:

  • export a copy of the certificate, for example from your browser certificate repository (in Firefox: Tools->Options->Advanced->Encryption->View Certificates etc.) - supposing you have have already visited the site with your browser;
  • detect which certificate repository your HTTPS API points to (there certainly is one)
  • import certificate into that repository
  • execute your program
AndreaG
Do you know of any way I could automate this process within vb6? so the process seems completely transparent to the user?
neddy
I don't know much about VBasic.Notice anyway that this is a one-time only process, albeit a manual one, and that users should be aware of whom they are trusting.Maybe you can pre-build the certificate repository, and distribute it together with the application.You really should read documentation about VB security model.If the control shares the actual browser repository, you might add as a requirement that users connect, once and for all, to the web service via the "real" browser and accept the site certificate.
AndreaG