Has anyone had any success using a self signed certificate on iOS?
Attempting to do a WWW https call in Unity iOS build generates the error:
Error: The certificate for this server is invalid. You might be connecting to a server that is pretending to be “sub.domain.com” which could put your confidential information at risk.
// If you need to communicate with HTTPS server with self signed certificate you might consider UnityWWWConnectionSelfSignedCertDelegate
// Though use it on your own risk. Blindly accepting self signed certificate is prone to MITM attack
//const char* WWWDelegateClassName = "UnityWWWConnectionSelfSignedCertDelegate";
const char* WWWDelegateClassName = "UnityWWWConnectionDelegate";
// If you need to communicate with HTTPS server with self signed certificate you might consider UnityWWWConnectionSelfSignedCertDelegate
// Though use it on your own risk. Blindly accepting self signed certificate is prone to MITM attack
//const char* WWWDelegateClassName = "UnityWWWConnectionSelfSignedCertDelegate";
const char* WWWDelegateClassName = "UnityWWWConnectionDelegate";
In XCode, you’ll find the file in your XCode project, this needs to be modified every time you rebuild (including append) from Unity as Unity will overwrite the file each time.
It doesn’t work for me.
I still get the “The certificate for this server is invalid. You might be connecting to a server that is pretending to be “www.mywebsite” which could put your confidential information at risk.” message after uncommenting the UnityWWWConnectionSelfSignedCertDelegate line.
Is there anything else to do?
// If you need to communicate with HTTPS server with self signed certificate you might consider UnityWWWConnectionSelfSignedCertDelegate
// Though use it on your own risk. Blindly accepting self signed certificate is prone to MITM attack
const char* WWWDelegateClassName = "UnityWWWConnectionSelfSignedCertDelegate";
//const char* WWWDelegateClassName = "UnityWWWConnectionDelegate";
I’ve done this recently and it works 100% fine for me, remember if you rebuild from Unity it will overwrite this file every time and you need to make the changes again (unless you script is some way).
Yes, I did make it look like that, cleaned and rebuilt and it is still giving me the “The certificate for this server is invalid. You might be connecting to a server that is pretending to be” error.
I didn’t rebuild from Unity.
I have the same problem with my WWWForm. I have tried so many solution, but nothing helps.
Should I try this in combination with AllowArbitraryLoads in plist?
//const char* WWWDelegateClassName = “UnityWWWConnectionSelfSignedCertDelegate”;
Or are there cases in which there is no way to allow insecure certificates? (certificate on wrong domain perhaps?) Our test environment is a bit of a mess.
I am facing the same issue. Trying to download something using www and I am setting //const char* WWWDelegateClassName = “UnityWWWConnectionSelfSignedCertDelegate”; too still getting
Error: The certificate for this server is invalid. You might be connecting to a server that is pretending to be “sub.domain.com” which could put your confidential information at risk.
Anyone who have fixed this and how please let us know. It’s a kind of show stopper for us. Thanks!