ios - SSL certificate FQDN for REST web service at a specific path -
i using ios connect server using certificate cn (commonname) , fqdn (fully qualified domain name) server.myexample.com
. server certificate signed own root ca (whose certificate added anchor certs via sectrustsetanchorcertificates
, verified via method described here using nsurlauthenticationchallenge
).
with ios client, attempting connect rest service located at: server.myexample.com/path1/service1
, kept receiving following error:
the certificate server invalid. might connecting server pretending “server.myexample.com” put confidential information @ risk. error occurred while fetching https://server.myexample.com/path1/service1: error domain=nsurlerrordomain code=-1202 "the certificate server invalid. might connecting server pretending “server.myexample.com” put confidential information @ risk."
i additional messages same info specifying errors: nserrorfailingurlstringkey
, nsurlerrorfailingurlpeertrusterrorkey
.
i found call service server.myexample.com/service1
, removed path1 request url, , server certificate verification worked correctly. why this? under impression server needed 1 certificate, meaning services hosts using same certificate. maybe need separate server certificate per path? not aware paths after server ip address/domain needed have own certificate.
to summarize:
- ios client app root ca certificate in anchor certs
- server
server1
's certificate signed root ca has cn ofserver.myexample.com
, fqdnhttps://server.myexample.com
. - server
server.myexample.com
hostsservice1
can accessed web browser via:https://server.myexample.com/service1
(passes ios client's authentication of server)https://server.myexample.com/path1/service1
(fails ios client's authentication of server)
- ca , server certificates created via openssl
thanks in advance!
Comments
Post a Comment