Skip to content

Instantly share code, notes, and snippets.

@justinsteven
Last active September 22, 2019 01:05
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save justinsteven/bae3459e16e976c676347c2007aac1a3 to your computer and use it in GitHub Desktop.
Save justinsteven/bae3459e16e976c676347c2007aac1a3 to your computer and use it in GitHub Desktop.
How to fix Cydia Impactor "http-win.cpp:160" error as of 2018-08-11

How to fix Cydia Impactor "http-win.cpp:160" error as of 2018-08-11

As per https://www.reddit.com/r/jailbreak/comments/95qb5d/discussion_cydia_impactor_ccp_160_error_megathread/ Cydia Impactor is currently throwing the following error on Windows:

---------------------------
Error
---------------------------
http-win.cpp:160
Peer certificate cannot be authenticated with given CA certificates
SSL certificate problem: self signed certificate in certificate chain
---------------------------
OK
---------------------------

tl;dr

Note: This very hacky fix is not thoroughly tested and may cause issues. Hopefully an updated Cydia Impactor is released soon to truly address the problem.

  1. Make a backup copy of the file Impactor.dat (it comes with Cydia Impactor and should be in the same directory as your Impactor.exe) just in case
  2. Open the original Impactor.dat in 7zip
  3. Delete verisign-2048-256.pem from inside of Impactor.dat using the 7zip window
  4. Use notepad.exe to save the following text to a new file on your hard drive. The file should be called verisign-2048-256.pem (without the usual .txt extension!)
-----BEGIN CERTIFICATE-----
MIIDjjCCAnagAwIBAgIQAzrx5qcRqaC7KGSxHQn65TANBgkqhkiG9w0BAQsFADBh
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBH
MjAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUxMjAwMDBaMGExCzAJBgNVBAYTAlVT
MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j
b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEcyMIIBIjANBgkqhkiG
9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuzfNNNx7a8myaJCtSnX/RrohCgiN9RlUyfuI
2/Ou8jqJkTx65qsGGmvPrC3oXgkkRLpimn7Wo6h+4FR1IAWsULecYxpsMNzaHxmx
1x7e/dfgy5SDN67sH0NO3Xss0r0upS/kqbitOtSZpLYl6ZtrAGCSYP9PIUkY92eQ
q2EGnI/yuum06ZIya7XzV+hdG82MHauVBJVJ8zUtluNJbd134/tJS7SsVQepj5Wz
tCO7TG1F8PapspUwtP1MVYwnSlcUfIKdzXOS0xZKBgyMUNGPHgm+F6HmIcr9g+UQ
vIOlCsRnKPZzFBQ9RnbDhxSJITRNrw9FDKZJobq7nMWxM4MphQIDAQABo0IwQDAP
BgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUTiJUIBiV
5uNu5g/6+rkS7QYXjzkwDQYJKoZIhvcNAQELBQADggEBAGBnKJRvDkhj6zHd6mcY
1Yl9PMWLSn/pvtsrF9+wX3N3KjITOYFnQoQj8kVnNeyIv/iPsGEMNKSuIEyExtv4
NeF22d+mQrvHRAiGfzZ0JFrabA0UWTW98kndth/Jsw1HKj2ZL7tcu7XUIOGZX1NG
Fdtom/DzMNU+MeKNhJ7jitralj41E6Vf8PlwUHBHQRFXGU7Aj64GxJUTFy8bJZ91
8rGOmaFvE7FBcf6IKshPECBV1/MUReXgRPTqh5Uykw7+U0b6LJ3/iyK5S9kJRaTe
pLiaWN0bfVKfjllDiIGknibVb63dDcY3fe0Dkhvld1927jyNxF1WW6LZZm6zNTfl
MrY=
-----END CERTIFICATE-----
  1. Add the file you created in step 4 to the inside of Impactor.dat using your 7zip window from step 2

The long version

By capturing some Cydia Impactor traffic using Wireshark, we see that the host https://developerservices2.apple.com is using the following certificate chain:

  • 0c:8b:7f:c5:c8:ed:73:80:29:7a:a7:d3:52:5a:4c:6a (Apple's leaf certificate, valid as of 2018-07-25)
  • Which is signed by 0c:8e:e0:c9:0d:6a:89:15:88:04:06:1e:e2:41:f9:af (Digicert Global CA G2)
  • Which is signed by 03:3a:f1:e6:a7:11:a9:a0:bb:28:64:b1:1d:09:fa:e5 (Digicert Global Root G2 - the trusted root certificate for the chain)

This trusted root certificate can be obtained directly from DigiCert and then pem-encoded using the following:

% curl -s https://dl.cacerts.digicert.com/DigiCertGlobalRootG2.crt | openssl x509 -in - -inform der    
-----BEGIN CERTIFICATE-----
MIIDjjCCAnagAwIBAgIQAzrx5qcRqaC7KGSxHQn65TANBgkqhkiG9w0BAQsFADBh
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBH
MjAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUxMjAwMDBaMGExCzAJBgNVBAYTAlVT
MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j
b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEcyMIIBIjANBgkqhkiG
9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuzfNNNx7a8myaJCtSnX/RrohCgiN9RlUyfuI
2/Ou8jqJkTx65qsGGmvPrC3oXgkkRLpimn7Wo6h+4FR1IAWsULecYxpsMNzaHxmx
1x7e/dfgy5SDN67sH0NO3Xss0r0upS/kqbitOtSZpLYl6ZtrAGCSYP9PIUkY92eQ
q2EGnI/yuum06ZIya7XzV+hdG82MHauVBJVJ8zUtluNJbd134/tJS7SsVQepj5Wz
tCO7TG1F8PapspUwtP1MVYwnSlcUfIKdzXOS0xZKBgyMUNGPHgm+F6HmIcr9g+UQ
vIOlCsRnKPZzFBQ9RnbDhxSJITRNrw9FDKZJobq7nMWxM4MphQIDAQABo0IwQDAP
BgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUTiJUIBiV
5uNu5g/6+rkS7QYXjzkwDQYJKoZIhvcNAQELBQADggEBAGBnKJRvDkhj6zHd6mcY
1Yl9PMWLSn/pvtsrF9+wX3N3KjITOYFnQoQj8kVnNeyIv/iPsGEMNKSuIEyExtv4
NeF22d+mQrvHRAiGfzZ0JFrabA0UWTW98kndth/Jsw1HKj2ZL7tcu7XUIOGZX1NG
Fdtom/DzMNU+MeKNhJ7jitralj41E6Vf8PlwUHBHQRFXGU7Aj64GxJUTFy8bJZ91
8rGOmaFvE7FBcf6IKshPECBV1/MUReXgRPTqh5Uykw7+U0b6LJ3/iyK5S9kJRaTe
pLiaWN0bfVKfjllDiIGknibVb63dDcY3fe0Dkhvld1927jyNxF1WW6LZZm6zNTfl
MrY=
-----END CERTIFICATE-----

Cydia Impactor ships with a file called Impactor.dat which contains several trusted root CA certificates:

  • geotrust-2048-256.pem
  • verisign-1024-128.pem
  • verisign-2048-128.pem
  • verisign-2048-256.pem

Replacing any of these with a PEM-encoded copy of the Digicert Global Root G2 certificate seems to fix the "http-win.cpp:160" error.

https://twitter.com/justinsteven

@Ivan9900kar
Copy link

Made an account just to say this, but it works! Thanks!

@Ahmo02
Copy link

Ahmo02 commented Aug 11, 2018

I swear to god, me too. I only created this account to say thank you alot man. Only fix i found on the internet.

@SertixGamer
Copy link

I just registered to thank you very much! thank you thank you thank you!

@Sphyn0x
Copy link

Sphyn0x commented Aug 11, 2018

Just registered too, works like a charm, THANK YOU!

@AAPL85
Copy link

AAPL85 commented Aug 11, 2018

Tks!! the #1 Works for Me :D

@dany4president
Copy link

Thank you very much! Worked perfectly.

@ImpactorNotWorking
Copy link

now getting a 7460 error in Impactor

@githubos1
Copy link

PERFECT for me as well - needed to resideload g0blin jb
iPhone6, iOS 10.2.1,

  • revoked certificates with patched (above methode) Impactor 0.9.4.3 (for win)
  • resigned with patched (above methode) Impactor 0.9.4.4 (for win)

Thank's a million !!
Oliver

@nkujomiru
Copy link

Works perfectly on Win10, thanks a LOT

@kaka1555
Copy link

thx so much , only method that worked and i created an account just to thank you <3

@rosenoire57
Copy link

Bonjour, je m'inscris juste pour vous dire un énorme merci !!!!!

Copy link

ghost commented Aug 12, 2018

I did exactly what the main post suggested and now I'm getting this error:

_http-lnx.cpp:92
assert(cert != NULL)

Does anyone know how to fix it? tks in advance.

I'm using cydia 0.9.44 and installing NvwaStone_1.1.ipa

========================================================

Now I tried with newest Impactor64_0.9.45 version with default Impactor.dat and works!!

@judibulu
Copy link

its work, using impactor.dat in impactor0.943 folder to revoke
and using impactor.dat in impactor 0.944 to re-jb

thx in advance

@almcarvalho
Copy link

when I click add in 7zip I get the error: not suported operation :/ pls help

@SoulxDD
Copy link

SoulxDD commented Aug 15, 2018

@almcarvalho and for any other users getting the Error that you cannot ADD a file into Impactor.dat using the provided "Add" button - Just drag and drop while you have Impactor.dat open with 7zip! :D

Also, thank you Justin for the quick and easy fix and easy to follow instructions!

@machyavelly
Copy link

THANK YOU SO MUCH
your god bless you :)

@casthieleseban
Copy link

Muchas gracias, si bien esta en otro idioma, me funciono, Gracias.

@santanaruben
Copy link

Hi guys cydia impactor 0.9.45 was released and solves the problem. Thanks to @justinsteven.

@silviu2488
Copy link

Thank you!

@gggomg
Copy link

gggomg commented Sep 10, 2018

Thanks a lot, my friend!

@nalomoly
Copy link

Thanks its works :D

@bakhtarn
Copy link

bakhtarn commented Jan 2, 2019

You are awsome !!

@Emmanuelgyamfi
Copy link

You are a genius buddy
Thanks so much
Had to sign up to thank you. Keep up bro

@g4merjb
Copy link

g4merjb commented Mar 28, 2019

I love when the correct solution is on the first page of results after googling the problem. Thank you very much guys

@PacoVD
Copy link

PacoVD commented Apr 11, 2019

You are a genius JustinSteven thank you

@PacoVD
Copy link

PacoVD commented Apr 11, 2019

I did installed fine, however, the App doesn't launch, when I click on the Icon it shows the Niantic screen for a sec. then disappears

@kira11111999
Copy link

Thank you very much :D You're such a genius!

@GrigoriiTarasov
Copy link

Not working at all. Causing new problem 95

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment