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

sha512.badssl Certificate failed #2

Closed
aancw opened this issue Aug 8, 2022 · 7 comments
Closed

sha512.badssl Certificate failed #2

aancw opened this issue Aug 8, 2022 · 7 comments

Comments

@aancw
Copy link

aancw commented Aug 8, 2022

Hi,

I'm using your app and the application is showing error when clicking the button. It say that sha512.badssl certification error. SSL Certificate for target is expired

Screen Shot 2022-08-08 at 18 40 46

@pimterry
Copy link
Member

pimterry commented Aug 8, 2022

Hi @aancw, thanks for getting in touch.

That error is not coming from HTTP Toolkit at all though. The certificate for that site really has expired. When visiting it in any browser on any device you like you will see this error, even without using HTTP Toolkit.

In fact, I'm not sure what your setup is, but it looks like the browser you're showing isn't actually being intercepted by HTTP Toolkit at all. If it was, the 'Issuer' would say 'HTTP Toolkit CA'. If you do try to visit the site using a browser intercepted by HTTP Toolkit, you will see a "Certificate has expired" error, but within a normal secure response, because the HTTPS connection (from your browser to HTTP Toolkit) will work correctly, and only the upstream connection (HTTP Toolkit to the server) will fail because of the failed certificate.

Does that make sense? In both cases, HTTP Toolkit isn't doing anything wrong here - the problem is that that server's certificate really has expired. This is tracked by the team running that service here: chromium/badssl.com#501. I'd suggest getting in touch with them directly if you want to help get that fixed.

@pimterry pimterry closed this as not planned Won't fix, can't repro, duplicate, stale Aug 8, 2022
@aancw
Copy link
Author

aancw commented Aug 8, 2022

I know that the problem is in the server. What i mean, can this server url changed? Because this app cannot running without proxy. I'm using this app for the article but the demo showing error when pinning the request.

@pimterry
Copy link
Member

pimterry commented Aug 8, 2022

I don't understand what you mean. Which article? Which app?

@aancw
Copy link
Author

aancw commented Aug 8, 2022

Nevermind, I've forked the repo and change the url that work for this app and signed the apk too.

https://github.com/aancw/android-ssl-pinning-signed-demo

telegram-cloud-photo-size-5-6307351008698806546-y

@pimterry
Copy link
Member

pimterry commented Aug 9, 2022

Ah, I see! Sorry, I had no idea what you were talking about before. That makes a lot more sense now, thanks for the screenshot and info.

This is now fixed in the app, there's an updated v1.3.0 available that should work correctly: https://github.com/httptoolkit/android-ssl-pinning-demo/releases/tag/v1.3.0

@pimterry pimterry closed this as completed Aug 9, 2022
@pimterry
Copy link
Member

pimterry commented Aug 9, 2022

I think the v1.3.0 APK is signed already, isn't it? I was doing this manually before, but it's now automated: 04a5c5d.

If you download it, you can test that for yourself:

$ apksigner verify --print-certs ./pinning-demo.apk
Signer #1 certificate DN: CN=Tim Perry, OU=Unknown, O=HTTP Toolkit, L=Barcelona, ST=Barcelona, C=ES
Signer #1 certificate SHA-256 digest: 03235c7ac4d8111ea7b56152841acdb8d9570968885826d00c604b3bbb8c7b68
Signer #1 certificate SHA-1 digest: 985c29731c39325874d93f2f0f0e47af4f1828bd
Signer #1 certificate MD5 digest: df7af10590483a886870630400079767

I think that error above is because you have an app installed with the same package id but a different signature. The signature is different in this build because I've just generated a new key store for this, but if you uninstall the old version before you install the new version it should work. I don't think that matters too much, I don't expect many people are going to be upgrading between versions here, it's just a demo app.

@aancw
Copy link
Author

aancw commented Aug 9, 2022

Nice, last time I fork the repo, the apk is not signed when running github workflow. That's why I make update on ci.yml to sign the apk. So it can be installed on the 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

2 participants