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

Doesn't automatically trust installed cert #12

Open
scotthmccoy opened this issue Dec 12, 2019 · 8 comments
Open

Doesn't automatically trust installed cert #12

scotthmccoy opened this issue Dec 12, 2019 · 8 comments

Comments

@scotthmccoy
Copy link

Running ./iosCertTrustManager.py -a cert_authority.pem correctly installs my cert but I have to manually visit the General -> About -> Certificate Trust Settings page on each simulator and flip the switch to trust the installed cert.

Somehow Charles' install-charles-ca-cert-for-iphone-simulator.sh script is able to both install and trust their cert on my simulators and they seem to use the same basic mechanism (writing to ls ~/Library/Developer/CoreSimulator/Devices/*/data/Library/Keychains/TrustStore.sqlite3) so I feel like I must be missing something.

Any advice?

@NghiaTranUIT
Copy link

Just tested on Proxyman, which use a this script for installing Proxyman CA to iOS Simulators, and it does install & enable the Trust Setting in iOS Simulator 13.2.2 (Xcode 11.2.1).

Which version are you using?

Ref: https://docs.proxyman.io/debug-devices/ios-simulator

@scotthmccoy
Copy link
Author

I just tried with the most recent version and it did not trust the cert:
image

@NghiaTranUIT
Copy link

Look like iOS Simulator 13.3 change the way how to enabled it. Let me test it

@NghiaTranUIT
Copy link

Screen Shot 2019-12-12 at 11 32 51

Just tested on Xcode 11.3 and iOS 13.3 Simulator and the script is work well with no extra arguments. Work with Proxyman.

Here is the minimal version of this script: https://gist.github.com/NghiaTranUIT/114e50e327888ff447f96fb7ef541db2

@scotthmccoy
Copy link
Author

I tend to wipe my simulators, boot them, wait 60 seconds to make sure they are booted and then run the script. I'm starting to suspect that doing so prevents new certs from being trusted in some way.

I've read somewhere that the TrustStore db doesn't exist until the sim tries to make an https connection, but I've not found that to be true, nor does making the sim navigate to an https page seem to alleviate the problem of the cert not being trusted on installation.

@scotthmccoy
Copy link
Author

scotthmccoy commented Dec 12, 2019

Also, I don't think this issue is limited to me. it looks like 2 other users are experiencing this same issue but they describe it differently: #11

@basterboy
Copy link

Hi, I have similar issue. The only difference is the cert is selected as trusted(on Certificate Trust Settings screen) but it doesn't work. I need to flip the toggle to non-trust then switch to trust again to make it work. I use iPhone 11 simulator - 13.3.

Installation steps:

  1. delete existing iPhone 11 sim from Xcode(devices and simulators menu).
  2. create a new one.
  3. launch the simulator.(there is no ./Keychains/TrustStore.sqlite3 db unless you launch the simulator)
  4. close the simulator
  5. run iosCertTrustManager.py script with parameters(-a ./mySert.pem -t /Users/user/Library/Developer/CoreSimulator/Devices/CB2145A4-3D93-457D-91EE-ED85CB25765C/data/Library/Keychains/TrustStore.sqlite3)
  6. there aren't any errors in console. the cert added successfully - Certificate added
  7. launch the simulator again.

I use a self-signed cert, can it be a problem?

@sotayamashita
Copy link

sotayamashita commented Dec 10, 2020

FYI: Tested on Xcode 12.2 and iOS 14.2 Simulator. The script which @NghiaTranUIT provided, works well with the mitmproxy.

-- update 2020/12/11
However, I cannot see https://appele.com due to not trusted. 😢 I can see https://google.com 🤔
@NghiaTranUIT Do you have any idea? I am using mitmproxy's certificate for it. Thanks in advance

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

4 participants