[GH-ISSUE #1179] Installing simulator certificates twice #1172

Open
opened 2026-03-03 19:48:58 +03:00 by kerem · 6 comments
Owner

Originally created by @CyberMew on GitHub (Mar 18, 2022).
Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1179

In order for it to work, I seemed to have to install and trust, reboot, install and trust, reboot. Twice at least, always.

Charles proxy does not do this dance at all, and is able to achieve this without any restart. Is it possible to do something similar, if not fix it to only do it once?

Originally created by @CyberMew on GitHub (Mar 18, 2022). Original GitHub issue: https://github.com/ProxymanApp/Proxyman/issues/1179 In order for it to work, I seemed to have to install and trust, reboot, install and trust, reboot. Twice at least, always. Charles proxy does not do this dance at all, and is able to achieve this without any restart. Is it possible to do something similar, if not fix it to only do it once?
Author
Owner

@NghiaTranUIT commented on GitHub (Mar 19, 2022):

Sorry but I could not reproduce it. I'm using Xcode 13.2.1 and I'm able to install the certificate on iOS 15.2 simulator once.

without any restart.

Actually, you don't need to restart your simulator because Proxyman is using simctl command line.

  • Please make sure that you're using the simctl mode in (Preference -> Tools -> Use simctl for iOS Simulator (It's a default option)).
  • Make sure your iOS Simulator is opened. simctl only works for booted and opened iOS Simulators.

If you encounter your issue, please help me test this out:

  1. Open your Simulator (Erase all Content to make sure there is no certificate)
  2. Open Proxyman -> Certificate Menu -> Install for iOS -> Simulator
  3. Click on the 2nd button (Don't need to restart on the 3rd step)
  4. Open iOS Simulator -> Setting -> General -> Trust Certificate
  5. Verify that you can see Proxyman CA is installed and trusted
<!-- gh-comment-id:1072920611 --> @NghiaTranUIT commented on GitHub (Mar 19, 2022): Sorry but I could not reproduce it. I'm using Xcode 13.2.1 and I'm able to install the certificate on iOS 15.2 simulator once. > without any restart. Actually, you don't need to restart your simulator because Proxyman is using `simctl` command line. - Please make sure that you're using the `simctl` mode in (Preference -> Tools -> Use `simctl` for iOS Simulator (It's a default option)). - Make sure your iOS Simulator is opened. `simctl` only works for booted and opened iOS Simulators. If you encounter your issue, please help me test this out: 1. Open your Simulator (Erase all Content to make sure there is no certificate) 2. Open Proxyman -> Certificate Menu -> Install for iOS -> Simulator 3. Click on the 2nd button (Don't need to restart on the 3rd step) 4. Open iOS Simulator -> Setting -> General -> Trust Certificate 5. Verify that you can see Proxyman CA is installed and trusted
Author
Owner

@CyberMew commented on GitHub (Mar 20, 2022):

I tested it on a newly launched simulator that I did not launch before.

Step 4 does not show the certificate. Repeating step 2 does nothing.

This is my experience:

  1. Launch a new simulator iOS version (can be 13.x, 14.x, 15.x of any iPhone simulator, all had the same problem)
  2. Install (but nothing in General)
  3. Reboot (nothing in General)
  4. Install (nothing in General)
  5. Reboot (yes it shows up now)

I have not yet check the simctl mode but I don't think I touched it before. I will check in a bit and report back.

<!-- gh-comment-id:1073305212 --> @CyberMew commented on GitHub (Mar 20, 2022): I tested it on a newly launched simulator that I did not launch before. Step 4 does not show the certificate. Repeating step 2 does nothing. This is my experience: 1. Launch a new simulator iOS version (can be 13.x, 14.x, 15.x of any iPhone simulator, all had the same problem) 2. Install (but nothing in General) 3. Reboot (nothing in General) 4. Install (nothing in General) 5. Reboot (yes it shows up now) I have not yet check the simctl mode but I don't think I touched it before. I will check in a bit and report back.
Author
Owner

@CyberMew commented on GitHub (Mar 21, 2022):

Yes can confirm it is already using simctl mode. Not sure if it is a fluke, but after a restart of the laptop and installing it on 15.x it works. But after a few times it stop working properly again - video shows install-reboot-install working but previous i had to do install-reboot-install-reboot. Charles did not have this kind of issue at all I think. Also, previously when I did the install-reboot-install-reboot action, the installed cert would have today's date. But in my recent tries just now, it is using some old cert (the day I installed Proxyman on this laptop maybe), not sure why. Another point to investigate why such bugs happen could be that I never close Proxyman and I can install the certs to multiple devices over a period of time on the same instance, maybe repeated actions of some sort breaks it? Hope it helps.

https://user-images.githubusercontent.com/4715911/159200815-5ea90390-485b-4ac3-aa72-017f82df09fe.mov

<!-- gh-comment-id:1073445723 --> @CyberMew commented on GitHub (Mar 21, 2022): Yes can confirm it is already using simctl mode. Not sure if it is a fluke, but after a restart of the laptop and installing it on 15.x it works. But after a few times it stop working properly again - video shows install-reboot-install working but previous i had to do install-reboot-install-reboot. Charles did not have this kind of issue at all I think. Also, previously when I did the install-reboot-install-reboot action, the installed cert would have today's date. But in my recent tries just now, it is using some old cert (the day I installed Proxyman on this laptop maybe), not sure why. Another point to investigate why such bugs happen could be that I never close Proxyman and I can install the certs to multiple devices over a period of time on the same instance, maybe repeated actions of some sort breaks it? Hope it helps. https://user-images.githubusercontent.com/4715911/159200815-5ea90390-485b-4ac3-aa72-017f82df09fe.mov
Author
Owner

@NghiaTranUIT commented on GitHub (Mar 21, 2022):

Thanks for your video. It's hard to reproduce because Proxyman just simply executes the following code:

$ xcrun simctl keychain booted add-root-cert <certificate_path>

It might depend on the Xcode version are you using too. It seems the bug was from Xcode or simctl tool.

Can you verify which Xcode Command-Line you're using? (Find in Xcode Preference -> Location -> Command-Line Tool)

<!-- gh-comment-id:1073534866 --> @NghiaTranUIT commented on GitHub (Mar 21, 2022): Thanks for your video. It's hard to reproduce because Proxyman just simply executes the following code: ```bash $ xcrun simctl keychain booted add-root-cert <certificate_path> ``` It might depend on the Xcode version are you using too. It seems the bug was from Xcode or `simctl` tool. Can you verify which Xcode Command-Line you're using? (Find in Xcode Preference -> Location -> Command-Line Tool)
Author
Owner

@CyberMew commented on GitHub (Mar 22, 2022):

It is using 13.2.1

I am also on macOS 11.6.x if that matters.. Perhaps it is indeed some bug, but still weird it doesn't perform reliably. Thought it was my issue until I tried it with Charles which didn't have the issue (or maybe it was on a bug free simulator), but anyway not a blocked issue for now, hope a solution is found in future.

I am more worried about the cert, because it is using an old one instead of one that is generated that day. In my previous experiences (before recording this video), it installed a new cert dated on the same day.

<!-- gh-comment-id:1074919485 --> @CyberMew commented on GitHub (Mar 22, 2022): It is using 13.2.1 <img width="370" alt="" src="https://user-images.githubusercontent.com/4715911/159445701-162c9632-76ec-4549-9048-78dabdaede88.png"> I am also on macOS 11.6.x if that matters.. Perhaps it is indeed some bug, but still weird it doesn't perform reliably. Thought it was my issue until I tried it with Charles which didn't have the issue (or maybe it was on a bug free simulator), but anyway not a blocked issue for now, hope a solution is found in future. I am more worried about the cert, because it is using an old one instead of one that is generated that day. In my previous experiences (before recording this video), it installed a new cert dated on the same day.
Author
Owner

@NghiaTranUIT commented on GitHub (Mar 22, 2022):

Thanks for your insight. If you've still encountered this issue, please try help me to quit the iOS Simulator -> Open it again -> Check whether or not you can see the certificate.

I assume that the Setting app might properly not reload the certificate until we close the Setting app or re-open the Simulator.

<!-- gh-comment-id:1075017038 --> @NghiaTranUIT commented on GitHub (Mar 22, 2022): Thanks for your insight. If you've still encountered this issue, please try help me to quit the iOS Simulator -> Open it again -> Check whether or not you can see the certificate. I assume that the Setting app might properly not reload the certificate until we close the Setting app or re-open the Simulator.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Proxyman#1172
No description provided.