swift - Call iOS webview HTTPS (self-signed certificate) -


i want call https url (self-signed certificate) in ios app. works on mobile browser not in app webview.

is there solution xcode 7 , swift 2.2?

    override func viewdidload() {         super.viewdidload()         // additional setup after loading view, typically nib.          let url = nsurl(string: "https://xxx.xxx.x.xxx:xxxx")          let request = nsurlrequest(url: url!)         webview.loadrequest(request)     } 

you have install self signed certificate or ca on device in order device trust device trusts ssl connection.

in case of installing self signed certificate make sure domain name of url same common name of certificate.

if there no domain name ip address fine.

certificate installation:

you can host on web server , try access safari ios prompt certificate installation in ios device

certificate creation:

here way create self signed certificate can fill details , host in web server.

openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 1001 -nodes 

(pay attention while entering value common name)


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -