Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improperly formatted DER-encoded message #182

Closed
Glavic opened this issue Aug 23, 2016 · 3 comments
Closed

Improperly formatted DER-encoded message #182

Glavic opened this issue Aug 23, 2016 · 3 comments

Comments

@Glavic
Copy link

Glavic commented Aug 23, 2016

In Firefox v48 I get following error while connecting to HTTPS website on which I use MITM:

An error occurred during a connection to wikipedia.org. security library: improperly formatted DER-encoded message. Error code: SEC_ERROR_BAD_DER

Script I use:

func main() {
    proxy := goproxy.NewProxyHttpServer()

    condition := goproxy.UrlMatches(regexp.MustCompile("^wikipedia.org:443"))

    proxy.OnRequest(condition).HandleConnect(goproxy.AlwaysMitm)
    proxy.OnResponse(condition).DoFunc(func(res *http.Response, ctx *goproxy.ProxyCtx) *http.Response {
        b, _ := ioutil.ReadAll(res.Body)
        res.Body = ioutil.NopCloser(bytes.NewBuffer(b))
        go DoStuff(b)
        return res
    })

    log.Fatal(http.ListenAndServe(":8081", proxy))
}

func DoStuff(b []byte) {
    fmt.Printf("Do something with byte len=%d\n", len(b))
}

What can be done?

@Glavic
Copy link
Author

Glavic commented Aug 23, 2016

Issue 142 is probably the same?

@alexio777
Copy link

Got same error.

@ErikPelli
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants