Results 1 to 2 of 2

Thread: Web browser control and certificates

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2004
    Posts
    2

    Web browser control and certificates

    I've done a login client for my internet connection which simply visits an https adress which includes account details and password otherwise submitted through a form on a webpage. It works fine, but I do get one of those annoying certificate alerts which forces me to press "Yes" before the program logins. I want the program to execute at startup, login and then terminate with no user intervention at all.

    Is there a way to make a Microsoft Web browser control to automatically accept/install persumed certificates it will encounter? Or maybe there are some other control/method better accommodated for this precise task?

    Or (this is kind of off topic) maybe it is possible to permanently install a certificate in Internet Explorer (like in Opera) so that whenever it is encountered, it is accepted? If so, maybe there is a way to have the program install the certificate in that manner?

  2. #2

    Thread Starter
    New Member
    Join Date
    Aug 2004
    Posts
    2
    Ok. I found something that might solve my problem. But my new problem is that I don't know how to use it with my AxWebBrowser control. Any ideas?

    VB Code:
    1. Imports System.Net
    2. Imports System.Security.Cryptography.X509Certificates
    VB Code:
    1. ServicePointManager.CertificatePolicy = New AcceptAllCertificatePolicy()
    VB Code:
    1. Public Class AcceptAllCertificatePolicy
    2.         Implements ICertificatePolicy
    3.  
    4.         Public Overridable Function CheckValidationResult(ByVal srvPoint As ServicePoint, ByVal certificate As X509Certificate, ByVal request As WebRequest, ByVal problem As Integer) As Boolean Implements ICertificatePolicy.CheckValidationResult
    5.             Return True 'this accepts all certificates
    6.         End Function
    7.     End Class

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width