javascript - How to call a web api via ajax over SSL from a local html file? -


i have local html file in may desktop accessing web api (jax-rs) responds json data. enabled cors , works fine, without ssl. how can make work ssl? use self-signed certificate , can call web api wpf application, javascript application (standalone html file), when chrome sends options pre-flight before post, request seems not reach server. tried import self-signed certificate in browser, nothing has changed.

the preflight request not allowed include entity body or credentials. if using preflighted requests cannot use 2 way ssl.

the solution change server make certificate optional. i've done using apache http server or tomcat assume other servers capable of this.

in apache setting should changed to

sslverifyclient optional 

and in tomcat ssl settings should changed to

clientauth="want" 

without change cors simple requests work.


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -