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

need ca.crt for some androids (not ca.pem) #96

Closed
l3iggs opened this issue Jul 25, 2016 · 4 comments
Closed

need ca.crt for some androids (not ca.pem) #96

l3iggs opened this issue Jul 25, 2016 · 4 comments

Comments

@l3iggs
Copy link

l3iggs commented Jul 25, 2016

The ca.pem provided here does not work for my android (n). I can get it to work by generating a ca.crt from your ca.pem like so:

openssl x509 -inform PEM -outform DM -in .http-mitm-proxy/certs/ca.pem -out .http-mitm-proxy/certs/ca.crt

but this requires the openssl binary which may not always be easy to come by. Could the project here directly generate the ca.crt that many of us need?
see: justinleewells/pogo-optimizer#108

@felicienfrancois
Copy link
Collaborator

We use node-forge (pure js) to generate the certificate.
You can use node-forge to convert the pem certificate into a crt certificate:

var fs = require('fs');
var forge = require('node-forge');
var cert = forge.pki.certificateFromPem(fs.readFile('.http-mitm-proxy/certs/ca.pem'));
fs.writeFile('.http-mitm-proxy/certs/ca.crt', forge.asn1.toDer(forge.pki.certificateToAsn1(cert)).getBytes(), {encoding: 'binary'});

@felicienfrancois
Copy link
Collaborator

Also, if you want to pre-generate the ca certificate files to avoid the sleep 10 hack, you can have a look at https://github.com/joeferner/node-http-mitm-proxy/blob/master/lib/ca.js#L145

@l3iggs
Copy link
Author

l3iggs commented Jul 26, 2016

@felicienfrancois Thanks very much!

@l3iggs l3iggs closed this as completed Jul 26, 2016
@saikrishna321
Copy link

@felicienfrancois I tried the above for android and I always see no-internet connection in my phone. Can you point me to any docs on how to setup for android/ios devices?

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