0

The java application I'm working used to call an inhouse rest service via http which delivers a PDF file as a response. The rest service has now changed it's url and switched from http to https.

I have changed the java code of my application accordingly and am now getting a http error 403 (forbidden) when calling the service.

I use the Apache Webclient and I have only changed the url and the scheme in the source code.

I talked to to the service programmer and it turns out, that his service does not do any authorization or authentication. There is also no certificate tied to his service.

When testing the rest servcice call in Insomnia I had to disable all validation of certificates before the call would work.

My question is: How do I configure the Apache Webclient so that there is no validation of certificates. I suspect that this is what causes the error 403.

Any help would be much appreciated! :)

Ciao Lars

PS: Don't ask why the service changes to https but uses no secure techniques whatsoever.

3
  • 1
    The HTTP status code 403 is returned from the server. It means access was Forbidden. You need to ask the server why. There is no way for us to know how it is configured. Also you haven't include a minimal reproducible example in your question. Commented Feb 28 at 12:32
  • 1
    Is this really a certificate problem? As @aled says - a 403 indicates the server is refusing your request for a different reason other than an HTTPS problem. (1) provide more evidence of your issues, (2) try using an industry-standard tool like curl, Postman, etc to eliminate that it is your java code. Commented Mar 1 at 0:35
  • As @AndrewL mentioned. If the server is responding an HTTP error is because the TLS connection in the HTTPS request was first established correctly. Commented Mar 1 at 3:01

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.