headzoo / surf

Stateful programmatic web browsing in Go.
MIT License
1.49k stars 160 forks source link

HTTPS Insecure Certificates #17

Closed omarpta closed 9 years ago

omarpta commented 9 years ago

Hi, it's just an idea... I had to modify browser.go file (buildClient func) to work with insecure certificates urls (https):

import (
      "crypto/tls"
)
 func (bow *Browser) buildClient() *http.Client {
    tr := &http.Transport{
        TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
        }
    client := &http.Client{Transport: tr}
    client.Jar = bow.cookies
    client.CheckRedirect = bow.shouldRedirect
    return client
}

Would be nice if it were configurable... :)

headzoo commented 9 years ago

Thanks for the ticket. This has been fixed in the master ( a917cf235 ). Browser now has a SetTransport() method so you can set your own.

ashishthedev commented 7 years ago

I was about to raise a ticket for this very issue and then discovered this thread. It would be nice if you can also update the documentation at http://surf.readthedocs.io/api/packages/browser/

Thanks.