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

No logs seen on emulators with iOS >= 15 and url in the form https://asfsaf-test-y5adsfas3a-ew.a.run.app with a valid ssl cert #1268

Closed
shadowsheep1 opened this issue Jun 27, 2022 · 35 comments
Assignees

Comments

@shadowsheep1
Copy link

shadowsheep1 commented Jun 27, 2022

Proxyman version? (Ex. Proxyman 1.4.3)

3.6.0 (30600)

macOS Version? (Ex. mac 10.14)

12.4

Steps to reproduce

Use Xcode 13.4.1 and an emulator with iOS 15.5 (certificates all right, on mac and on device).

With an iOS 15.5 devices no log are captured. Sometimes all start successfully, but suddenly there something wrong with the inspection. And no more logs are captured.

Screen Shot 2022-06-27 at 10 51 04

Screen Shot 2022-06-27 at 10 51 43

With and iOS with iOS 14.0 logs are captured.

Screen Shot 2022-06-27 at 10 48 18

Expected behavior

See logs of my application in any iOS version.

Gut feeling

It seems that the problem is the test url that is in the form https://asfsaf-test-y5adsfas3a-ew.a.run.app (but the certificate is valid, and in fact all works fine on emulators with iOS < 15)

@shadowsheep1 shadowsheep1 changed the title No logs seen on emulators with iOS >= 15 and url in the form https://https://asfsaf-test-y5adsfas3a-ew.a.run.app with a valid ssl cert No logs seen on emulators with iOS >= 15 and url in the form https://asfsaf-test-y5adsfas3a-ew.a.run.app with a valid ssl cert Jun 27, 2022
@NghiaTranUIT NghiaTranUIT self-assigned this Jun 27, 2022
@NghiaTranUIT
Copy link
Member

Thanks for the report @shadowsheep1, but I'm not sure whether or not this issue is related to Proxyman.

From your screenshot, I suppose that the certificate is properly installed on iOS 15.5 because you got the 401 Unauthorized Response Code (and you're able to see the entire HTTPS Response).

To verify why there is no request on Proxyman:

  1. Can you add the print() func on your networking class to verify that there are outgoing requests (on iOS 15.5)?
  • If there are requests, that don't display on Proxyman -> It's a Proxyman bug.
  • If there is no request, the bug is from your app

@shadowsheep1
Copy link
Author

shadowsheep1 commented Jun 27, 2022

Hi @NghiaTranUIT If you mean if the app makes the requests to the webserver, even without print() (I've already some log on my app side) I can confirm you that the app makes successfully api calls to the severs 'cause it works like a charm, only I cannot see any request on proxyman.

@shadowsheep1
Copy link
Author

shadowsheep1 commented Jun 27, 2022

@NghiaTranUIT

If I change the api endpoint with the production one, I can get the logs:

Screen Shot 2022-06-27 at 14 18 49

There's some proxyman log I can send you with a pm?

It seems that this behaviour is occurring only with the test url (with a valid ssl cert) and an iOS 15.5 emulator.

image

@NghiaTranUIT
Copy link
Member

@shadowsheep1 can you open Proxyman and try to capture the test traffic (https://asfsaf-test-y5adsfas3a-ew.a.run.app ) iOS 14.0 -> Then, Right Click -> Copy as cURL. Make sure the cURL has the --proxy http://localhost:9090

Then paste on the Terminal app, to see if Proxyman can capture it.

  • If Proxyman can capture it, it means the Test URL is working fine and the problem may be because the iOS 15.5

@shadowsheep1
Copy link
Author

@NghiaTranUIT this way is working
Screen Shot 2022-06-27 at 15 14 46

I can see the request under proxyman domains section

@NghiaTranUIT
Copy link
Member

So, your test URL is working and Proxyman can capture it.

If you don't mind, please try iOS 15.5 on Physical devices or different type of Simulator (such as iPad)

@shadowsheep1
Copy link
Author

shadowsheep1 commented Jun 27, 2022

@NghiaTranUIT yup, but already with an emulator with iOS < 15 I can capture my test endpoint with Proxyman.
So do you think that the problem is only about iOS 15.5 (emulator) or the pair Proxyman/Emulator with iOS 15.5? Anyway I'll try and report it back when done.

@NghiaTranUIT
Copy link
Member

Yes, I suppose so if this test URL displays on Proxyman from iOS 14, there is no reason that it doesn't appear on Proxyman.

Except its an error, but you've confirmed that your app is still working.

@shadowsheep1
Copy link
Author

@NghiaTranUIT on a Physical device running iOS 15 with Proxymen App I got no error. I'm able to proxy the request.

@shadowsheep1
Copy link
Author

My app is working fine. I debug it with Proxyman from more than 2 years. 🍻

@NghiaTranUIT
Copy link
Member

So, everything is working isn't it?

@shadowsheep1
Copy link
Author

@NghiaTranUIT all except the combinatioin of testurl+emulator with ios15. Is should be nice to know why, but I think I can live with this weight on my heart ;). I close the issue 'cause I don't think this is a proxyman issue, but of the pair test url and ios 15 (emulator). Thanks.

@timothy-pratama
Copy link

Hi, I'm also facing exactly the same issues. One thing that I can confirm the same between my case and @shadowsheep1 is that when the proxy tries to send the CONNECT request to the server, it's getting SSL Handshake failed. Based on https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/CONNECT, my guess is since the CONNECT request is failed, maybe iOS simulator 15 will directly connect to the server without using the proxy, and that's why the network traffic doesn't show in the proxy as well. As to why the CONNECT request is getting that error, I also have no idea.

I can confirm that this issue only happens in the iOS 15 simulator + certain domain combinations, not in the Proxy man itself. I've tried to use another proxy and the result is also the same. The only solution that I find working is just by downgrading the iOS simulator to < 15 and everything working now.

Hope this will give some insight. Thanks!

@NghiaTranUIT
Copy link
Member

@timothy-pratama Is your iOS app a native app, or Flutter, React Native?

@timothy-pratama
Copy link

timothy-pratama commented Jun 30, 2022

@timothy-pratama Is your iOS app a native app, or Flutter, React Native?

It's native apps, and the weird thing is sometimes the CONNECT request is successful, and sometimes the CONNECT request keeps getting the SSL handshake failed. And sometimes the CONNECT request is only successful when it's fresh install only. But I'm certain that this issue is not caused by Proxy Man since I've tried using other proxy and get the same result as well 🙏🏻

From @shadowsheep1 screenshot in this issue's description, we can see that the first traffic logged to proxy man is actually the CONNECT request and it's getting the SSL handshake failed, and after that, there is no more network traffic appears in Proxy Man.

@shadowsheep1
Copy link
Author

I can confirm that. I'll try to file an issue at Apple side.

@shadowsheep1
Copy link
Author

@timothy-pratama do you have a public url I can share with apple with a sample app to test it?

@shadowsheep1
Copy link
Author

shadowsheep1 commented Jul 4, 2022

@timothy-pratama are you using kotlin-native (ktor) for networking?

@timothy-pratama
Copy link

@shadowsheep1 unfortunately I don't have any public URL with a sample app to test it as well 🙏🏻. I'm using native swift for the networking (using alamofire)

@NghiaTranUIT
Copy link
Member

If Charles Proxy can capture this traffic, it means it's a bug from Proxyman.

if not, maybe it's from Apple side 😄

@timothy-pratama
Copy link

Proxy Man can only capture the CONNECT request that gets the SSL handshake failed error when the bug happened. After that error, there is no more traffic coming from the same domain captured in Proxy Man. I have tried to use Charles Proxy, and the result is the same with Proxy Man. The only solution was to downgrade my iOS simulator to 14.5 and everything works fine now (with the same code) 😀

@NghiaTranUIT
Copy link
Member

Hey guys, I suppose that Alamofire/URLSession might use the cached response version from disks, so it never hits the server => Proxyman never catches it.

If you don't mind, please delete your app on the Simulator and try again.

@timothy-pratama
Copy link

timothy-pratama commented Jul 12, 2022

Actually I have tried deleting the app before. The logs will be shown only for the first time running the app (fresh install). After that, the next time I start my apps, the logs will no longer appears in proxy man again and I will get the same SSL handshake failed error. I have also suspected there is a cache mechanism that causes this, so I have tried to open a screen in the app that has not been opened before (so I assume there should be no cache yet for that screen), but it still loaded successfully even though the log doesn't appear in Proxy Man

I'm still pretty sure it's something wrong in iOS 15 simulator because @shadowsheep1 has tried using a physical device running iOS 15 and doesn't get this error #1268 (comment)

Thank you for replying @NghiaTranUIT 🙏🏻

@shadowsheep1
Copy link
Author

@timothy-pratama are you still experiencing this issue? Actually today I'm able to proxy traffic with my iOS 15 simulator 🤷‍♂️

@NghiaTranUIT
Copy link
Member

Some users report they have the same issue on iOS 15 Simulator too. It also happens on Charles Proxy.

The only way to fix it is using the iOS Real Devices or using the iOS 14 Simulator.

@shadowsheep1
Copy link
Author

shadowsheep1 commented Jul 14, 2022

@NghiaTranUIT I know,but today the issue's disappeared to me. I also filed an issue to Apple with Feedback Assistant, maybe they could help. The fun fuct is that today the issue is no more an issue for my URL. 🤷‍♂️ (I'm this issue OP)

@timothy-pratama
Copy link

timothy-pratama commented Jul 14, 2022

Some users report they have the same issue on iOS 15 Simulator too. It also happens on Charles Proxy.

The only way to fix it is using the iOS Real Devices or using the iOS 14 Simulator.

Yes, I'm still facing it. But as @shadowsheep1 mentioned, this bug only happens in iOS 15 Simulators and it's intermittent too. So when the bug is gone, it will be working fine. But once the bug comes back, it will be buggy again for quite some time. Not sure though what is the trigger

@shadowsheep1
Copy link
Author

shadowsheep1 commented Jul 14, 2022

As mentioned above I filed an issue to Apple Dev Tools with Feedback Assistant posting device log, sample app, a video showing the issue and some more fancy stuff :) Let's see what they say. if they answer before iOS 16 😂, hoping iOS 16 doesn't have this very same bug.

@NghiaTranUIT
Copy link
Member

iOS 16 beta (Physical device) is buggy too 😄 #1293

@piercifani
Copy link

Any news on this regard? It's really starting to look like a deal breaker here...

@NghiaTranUIT
Copy link
Member

Sorry, @piercifani it's not a bug of Proxyman or Charles. It's the bug from iOS Simulator. If you use iOS Physica devices or iOS 14, the issue is gone 👍

@piercifani
Copy link

Hello @NghiaTranUIT,

Yes but I think that's not something they're going to fix. Have you considered spend a DTS ticket in order to have someone look at this? This way you could:

  • Double check nothing's wrong on your end
  • There is no can't be workaround
  • At least Apple Engineering takes a look at this and prioritises it.

Right now, this bug kind of defeats the purpose of Proxyman, and I know this is no fault of Proxyman... but still...

@robmathers
Copy link

Just chiming in here that I'm running into this as well. One build & run will work fine on the Simulator, and then the same (with no changes) will fail (networking works fine, but not capture in Proxyman). Seemingly happened around Xcode 13.4, but I'm not 100% sure. Interestingly, opening the same domain in Safari does capture it in Proxyman.

Would be nice if a DTS and Feedback (Radar) was opened, but a workaround would be great given iOS 16 seems to be worse off currently.

@NghiaTranUIT
Copy link
Member

NghiaTranUIT commented Aug 31, 2022

@robmathers You can confirm it by using with physical devices @robmathers. All traffic should be captured. On the other hand, some are missing on iOS Simulator. Test with Charles Proxy too.

To would around with iOS Simulator, I highly recommend using Atlantis framework: https://github.com/ProxymanApp/atlantis

@robmathers
Copy link

Thanks, I can confirm it does work as usual with physical devices, but not working with simulators is a big bug. Just hoping that we can collectively raise this issue with Apple to make some noise 🤷‍♂️

The framework is a good workaround, but not necessarily a great option to require a whole new dependency, especially in a work project. Not your fault I realize, but definitely good if we could get a fix sorted via Apple.

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

5 participants