I"m do the efforts to do a https contact to a service, I have a Privake crucial to for sure connection.

You are watching: This combination of host and port requires tls.

I hit:

http://localhost:8081/points/12345/searchI tried through https:// yet I gain from Postman:

Could not get any kind of responseThere was an error connecting to https://localhost:8081/points/12345/search.From the moment I wrote

server.ssl.key-store=classpath:KeyStore.jksserver.ssl.key-store-password=testin application.properties, I obtain the error message:

Bad request - This combination of host and port requires TLS

I have deleted every my password in my controller, I simply let the endpoint so the I can invoke it.


RestController
SpringBootApplicationpublic class MainApplication
RequestMapping(value = "/points/point/search", method = RequestMethod.GET) public PointsType getPoint(
PathVariable(value = "point") wire point) System.out.println("hi"); // never printed return null; public revolution void main(String<> args) SpringApplication.run(MainApplication.class, args); Here is the record application.properties:

spring.application.name=sgeserver.port=8081server.ssl.key-store=classpath:KeyStore.jksserver.ssl.key-store-password=testserver.ssl.key-alias=homologation-stagingserver.ssl.trust-store=classpath:TrustStore.jksserver.ssl.trust-store-password=testserver.ssl.client-auth=needsecurity.require-ssl=trueserver.tomcat.remote_ip_header=x-forwarded-forserver.tomcat.protocol_header=x-forwarded-protoWhat need to I carry out ?


spring-boot ssl
share
follow
edited Oct 29 "19 at 9:15
Juliatzin
asked Oct 28 "19 in ~ 17:13
*

JuliatzinJuliatzin
15.4k3131 yellow badges126126 silver- badges255255 bronze title
9
| show 4 much more comments

4 answers 4


energetic oldest Votes
47
I supplied https:// in ~ the beginning instead of http://, it functioned for me.


share
follow
edited Jul 16 at 14:05
*

Spectric
23.9k44 gold badges1414 silver- badges3636 bronze title
answer Feb 19 "20 in ~ 11:11
*

SerdarAtalaySerdarAtalay
48666 silver badges55 bronze title
2
add a comment |
1
I acquired this message because I was utilizing wrong certificate.

I misunderstood customer certificate and Server certificate.

In my case, I mounted my certificate on the server, for my domain, but what I necessary to do instead is to usage it to make the request, together a customer certificate.

you can examine it how to perform it here.

Client Certificate Authentication through Spring Boot

So this article is basically saying: "Hey, her SSL inquiry is no OK", ns can"t discover the cert file, or your cert record is no the an excellent one, together
SerdarAtalay says, it can also significate that you didn"t usage https:// prefix, etc.

Hope the helps!


share
follow
answer Jun 17 "20 in ~ 14:06
*

JuliatzinJuliatzin
15.4k3131 gold badges126126 silver badges255255 bronze badges
add a comment |
1
We can fix this by either of below noted solutions.

Use HTTPS rather of HTTPDisable TLS encryption from POSTMAN setting and usage HTTPCheck application properties server.ssl.enabled= true- HTTPS , false-HTTP

<1>: https://i.stack.imgur.com/vGOj9.pngenter image description here


re-superstructure
follow
answer Sep 8 at 18:53
*

ShubhamShubham
2111 bronze argorial
add a comment |
0
I had this concern when working on a Java Project in Debian 10 v Tomcat together the applications server.

The concern was that the application currently had https characterized as it"s default protocol while ns was using http to speak to the application in the browser.

I but tried using the https protocol in the internet browser but the didn"t attach throwing the error:

Secure link Failed

An error arisen during a link to 34.72.188.50:8009. SSL obtained a document that exceeded the preferably permissible length.

Error code: SSL_ERROR_RX_RECORD_TOO_LONG

The web page you space trying to watch cannot it is in shown due to the fact that the authenticity the the obtained data could not be verified.Please call the website owner to inform them of this problem.

Here"s just how I resolved it:

I very first had to produce a keystore document for the application, more like a self-signed certificate for the https protocol:

sudo keytool -genkey -keyalg RSA -alias tomcat -keystore /usr/share/tomcat.keystoreNote: You need to have actually Java mounted on the server to have the ability to do this. Java can be set up using sudo apt install default-jdk.

See more: Read Ore Dake Haireru Kakushi Dungeon: Kossori Kitaete Sekai Saikyou Raw Manga

Next, I added a https Tomcat server connector for the applications in the Tomcat server configuration document (/opt/tomcat/conf/server.xml):

sudo nano /opt/tomcat/conf/server.xmlAdd the following to the construction of the application. Notification that the keystore file location and also password are specified. Additionally a port for the https protocol is defined, i beg your pardon is different from the harbor for the http protocol:

So the complete server configuration for the applications looked preferred this in the Tomcat server configuration record (/opt/tomcat/conf/server.xml):

This time once I do the efforts accessing the application from the web browser using:

https://my-server-ip-address:https-portIn my situation it was:

https:35.123.45.6:8443it operated fine. Although, I had actually to expropriate a warning which added a security exemption for the website, because the certificate supplied is a self-signed one.