Visual Studio 2022 - Error loading Apple provisioning profiles
Hi!
I'm developing my MAUI app and testing it on my iOS device via Visual Studio 2022 (Version 17.7.6). But suddenly I've lost my sync with my developer apple account. I've tried on other PC on the same network and It works properly, but on my device, when adding my developer account I get this log error:
There was an error while syncing the syncing identities information, please check the logs.
Xamarin.Messaging.IDB.AppleProvisioningManager Error: 0 : System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.
Xamarin
Visual Studio
-
Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 24,666 Reputation points • Microsoft Vendor
2023-11-06T05:39:17.29+00:00 Via referring to Error while syncing Apple provisioning profiles. This error should be due to VS component indeed or version lagging.
Using Visual Studio Installer to update, does this issue still appear after updating Visual Studio?
-
Aranda Simarro, Ivan 0 Reputation points
2023-11-06T07:26:51.8533333+00:00 I've installed the lastest version of VS and the problem still the same. Also tried deleting “%LOCALAPPDATA%\Xamarin\iOS\Provisioning” and adding the Apple Account again, and still the problem.
-
Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 23,306 Reputation points • Microsoft Vendor
2023-11-07T06:38:38.46+00:00 The remote certificate is invalid according to the validation procedure.
This error means that the existing certificate doesn't match the Provisioning profile.
Do you enable some capabilities for your app? such as adding iCloud entitlement?
Do you have the same issue when building an empty Xamarin.Forms app on your physical iOS devices?
What iOS device are you testing on?
-
Nithin Sri 0 Reputation points
2023-11-07T06:43:26.31+00:00 The error message you're encountering suggests that there is an issue with the SSL/TLS certificate validation when trying to connect to Apple's servers. This issue can occur if there is a problem with the SSL certificate used for communication between your development environment and Apple's servers. Here are some steps you can take to resolve this problem: 1. Check Your Internet Connection: Ensure that your internet connection is stable and working properly. Sometimes, a temporary network issue can cause SSL/TLS certificate validation problems. 2. Update Visual Studio: Make sure you're using the latest version of Visual Studio 2022. It's possible that a newer version includes bug fixes or updates that can resolve this issue. 3. Check Date and Time Settings: Ensure that the date and time settings on your iOS device and the computer where Visual Studio is running are correct. An incorrect system date and time can cause SSL certificate validation errors. 4. Trust the Certificate: It's possible that the SSL/TLS certificate used for communication with Apple has changed or become invalid. You may need to manually trust the certificate. Here's how you can do it: - On your iOS device, open Safari and navigate to the Apple Developer portal or any other Apple-related website. You should see a certificate error in Safari. - Tap on the "Details" or "More Info" button, and there should be an option to trust the certificate. - Follow the on-screen instructions to trust the certificate. 5. Clear SSL Certificate Cache: Sometimes, cached SSL certificates can cause issues. You can try clearing the SSL certificate cache on your computer: - On Windows, open the "Internet Options" in the Control Panel, go to the "Content" tab, and click the "Clear SSL state" button. - On macOS, open Keychain Access, select the "System" keychain, and delete any outdated or problematic certificates. 6. Restart Visual Studio and Your iOS Device: After making any changes or attempting the solutions above, restart Visual Studio and your iOS device to ensure that the changes take effect. 7. Check Your Firewall and Proxy Settings: Make sure that your firewall or network proxy settings are not interfering with the SSL/TLS communication. Temporarily disabling any third-party firewalls or proxies may help diagnose the issue. If the problem persists after trying these steps, it's possible that there's a more complex issue with your development environment. You may need to contact Apple Developer Support or Xamarin/Microsoft Support for further assistance in diagnosing and resolving the issue. They may be able to provide additional guidance and support tailored to your specific situation.
-
Aranda Simarro, Ivan 0 Reputation points
2023-11-07T08:44:10.0133333+00:00 @Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) Thank you for your answer, but this is not the problem, my Apple Certificates are OK, I've tried other machine, same network and It works perfect with those apple certificates.
I'm afraid the message "The remote certificate is invalid according to the validation procedure" refers to the SSL/TLS certificate, not the Apple developer certificates... -
Aranda Simarro, Ivan 0 Reputation points
2023-11-07T08:56:52.93+00:00 @Nithin Sri Thank you for your answer.
I'm on a Windows machine using the latest Visual Studio Version (Version 17.7.6). The problem is when adding my developer account, certificates are not loading (sometimes get same error when adding account).Points 1and 2 checked. Point 3 not applied cause I'm not at this point. Tried point 4 (I'm on windows), and in chrome and edge, SSL apple certificate is OK.
Tried point 5, didn't work. 6 and 7 same result...
Add an snap of my problem:
-
Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 23,306 Reputation points • Microsoft Vendor
2023-11-11T03:54:24.8533333+00:00 From the screenshot, your apple developer account looks like an enterprise account, right? Do you click the Sign in with an enterprise account hyperlink and enter your credentials when adding this account?
In addition, is it possible for you to export the iOS certificate from your other work-well machines and then import the certificate to your current machine? (I mean skip sending request progress)
Also, please check if you have set up a network firewall that would cause this request to be blocked.
-
Aranda Simarro, Ivan 0 Reputation points
2023-11-13T08:56:58.3133333+00:00 Yes, it's an enterprise account and I signed in with this option.
Yes, I exported certificates from other work-well machines, but this is not the solution I'm looking for because It must work on my machine...
I've check network firewall, but it's not seems to be the problem... (it's the same conf on work-well machines) but what kind of request should I check on firewall?
-
Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 23,306 Reputation points • Microsoft Vendor
2023-11-14T05:41:47.2533333+00:00 Do you try removing the Apple account and logging again? After clicking the "OK" button (as shown in the screenshot), there is a button named "Import Certificate", could you import your iOS development certificate?
For this request error issue that was thrown by VS, it's recommended that you report a problem with VS, see Report a problem with Visual Studio - Visual Studio (Windows) | Microsoft Learn
-
Aranda Simarro, Ivan 0 Reputation points
2023-11-14T08:33:53.3+00:00 Yes, I've tried removing my apple account and adding again, nothing happened. And I've imported manually my certificate, but it should work the other way like It worked a few days ago and on other machines.
-
Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 23,306 Reputation points • Microsoft Vendor
2023-11-14T09:49:59.0566667+00:00 If so, please report a problem with VS, see Report a problem with Visual Studio - Visual Studio (Windows) | Microsoft Learn
Sign in to comment