I have an https url which is of String format. How can I convert it to File? I tried this but I’m getting error – URI scheme is not “file” Answer FileUtils.copyURLToFile worked well for me. Reference – https://commons.apache.org/proper/commons-io/apidocs/org/apache/commons/io/FileUtils.html#copyURLToFile-java.net.URL-java.io.File-
Tag: https
How to Log/ View AWS Java SDK HTTP(S) Requests
I am developing a Spring Boot Application that uses HTTPS Only. I am using AWS services and the corresponding AWS Java SDK. How can I view the HTTP(S) request that the java sdk methods call on the backend of my application? I want to make sure when doing uploads to S3, etc, that everything is done over HTTPS only as
Create http and https endpoint using camel in the same server with jetty
I am trying to create HTTP and HTTPS endpoint in one of my web service. I want secure few endpoints with HTTPS and other endpoints with plain HTTP. I am using the below code to do the same. The https works fine with this setup but the http endpoint does not work. If I remove the method call to configure
Quotation marks in Camel Content-Type header
I am trying to invoke a SOAP service using camel-http4. This service requires me to send the following header: Content-Type: application/soap+xml;charset=UTF-8;action=”ListBerichten”. I have to include the quotation marks, or otherwise the service will return a 400 code When I try this with a client like Postman or SoapUI or curl it works fine, but when I try it with Camel,
JBOSS EAP 6.4: Can not use the HTTPS schema in “soap:address” in generated WSDL
I have modified my standalone configuration to use HTTPS connector along with the HTTP connector: With this configuration, I am able to transfer the HTTP traffic to HTTPS URL. It works fine. I also have a webservice written in JAVA: Once application (service.ear) is deployed, I am able to see the wsdl at: But the WSDL service definition uses HTTP
Trusted SSL certificate showing as self signed
I have a trusted TLS certificate deliverd by DigiCert that I’m trying to use in a java/spring application exposing rest apis. I created a .p12 file with openssl doing the following : openssl pkcs12 -export -in mycertificate.cer -certfile mycertificate_INTERMEDIATE.cer -inkey myprivate_key.key -out myCert.p12 I am able to use this file in my application to access the app through https with
javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure java 1.7_45
I have an https web page that I need to access and get some file, I am using Java 1.7_45 and apache httpclient 4.5.1 when I execute the client request I get the error(If I change to Java 8 it works, but I cannot change it to Java 8): I tried everything that I found on the internet as add
How do I use client certificates in a client java application?
This is a topic that has taken me quite some time to figure out. There are bits and pieces of information scattered and one has to put everything together. I was hoping that with this post I could help others quickly assemble a working solution. I have a client-cert.pem, client-key.pem and a root.pem files and I need to used them
TLS with client certificate failing handshake
I am confused as to where exactly I need to include client certificate. Now, my first issue is that I don’t trust the server. I tried using default Java keystore file (cacerts) which has both Thawte and Digicert in it, and those are the root authorities of the server I’m trying to communicate with. I set that cacerts file as
Including a .pem certificate in a Java HTTP request
I am currently able to access a web service that requires a client certificate using the following curl command: curl -k -v –cert ./certificate.pem https://api.com/unit How do I make this request in a Java application? Notice that I need the -k flag which allows curl to make “insecure” SSL connections. This needs to be done in the Java application as