I want to connect to a Java Restful webservice that uses SSL from a Javascript client.
I could write standalone Java client that connects to the keystore and imports the certificates and could connect successfully.
How can I achieve the same thing using Javascript, XMLHttpRequest.
Thanks in advance for any pointers.
I'm not entirely sure I understand your question. But, to make a SSL asynchronous request against a server with JavaScript, the only change you need to make is to use https in your RESTful target URL instead of http.
Related
I have configured my Vert.x server built in Java to already handle HTTP connections properly, but I would like to add an additional layer of security through HTTPS. I use the standard fetch call to make POST requests to the server. I have searched through the Vert.x documentation already, but the only information I can find is if I use Vert.x as client code as well, but I would like to avoid that if possible. Is there a way to configure my client and server to work together to form a secure connection without having to build an encryption schema from scratch?
If I understood you correctly, you have but one VertX instance, without load balancer, and you would like to access it using HTTPS protocol.
It doesn't actually matter whether you access it through
When starting your VertX server, make sure you specify setSSL(true) and all the other arguments:
https://github.com/vert-x/vertx-examples/blob/master/src/raw/java/https/ServerExample.java#L39
I had to perfrom a mutual authentification with certificate between a Javascript client and a Server running with TomCat
I change the configuration of my server so it will find the trust/keys store
But for the client part,i found many exemples with a JAVA client using the javax.net.ssl to define parameters (keyStore/Truststore) but i did not found anything for a JavaScript Client
is it Possible and how i can do it?
Thanks a lot!
My situation is: I have a wsdl from a webservice (soap). With the Apache CXF i managed to geneate a client. That gives me a huge .js file, in theory a usable client to access from javascript and call the services.
The problem is: There is no information about how to use this client, neither which methods call to start a SOAP process.
If anyone has experience with this, or knows how to initiate the process, or even know any handfull tool to consume Soap based webservices from javascript would be really nice!
Thanks a lot.
Apache CXF has a sample about js client. You can check it out.
http://cxf.apache.org/docs/javascript-client-samples.html
If you need help specific to your webservice, then share its WSDL.
I was wondering if there would be a technical solution to calling a SOAP webservice that is using client authentication via certificates (xwss ; digital signatures over body, timestamp, binarysecuritytoken) from javascript. This means a keystore should be available and accessible, outgoing connection should be allowed,...
Any library exists for this? If needed a browser extension could be used?
Thanks for your thoughts.
Cheers.
There is no such thing as far as I know. Chrome extensions are very limited in what they can do.
The possible solution would be to make an extension that would do requests to web-services and then call a native messaging host to do XML digital signature verification in C++/C#/whatever.
For extension you will need a SOAP client in Javascript. I had to write my own implementation of SOAP client in Javascript to fulfill the task but there are some free libraries out there. See, for example, this one.
Is it possible to have a web service notify web clients when something occurs via HTTP request/response? Right now my client has to poll the server using HTTP Requests at an interval to check for updates, but it would be far more convenient if I could register a javascript function to the server from my client and have it be simply called when server state changes.
Note that the web service is written in Python and utilizes HTTP APIs (I think it uses cherrypy, if that's relevant).
If this is possible could someone point me to some tutorial that explains how to do this or give me a basic understanding of how this can be accomplished?
Look into Comet
You can't start a request from the server to the client. You can only poll the server (which you did), use a hidden iframe, use a plugin, or use the new HTML5 WebSockets which allows the server to send a message to the client.
If you are into Node.JS, look into socket.io and hook.io
https://github.com/hookio
https://socket.io