SSL (HTTPS) support in functional web framework - spring-web

How am I supposed to to configure SSL for a Spring Boot Service using the functional web framework?
The configuration via setting server.ssl.* properties does not work (meaning nothing happens at all) and if I am reading the docs right, only server.port and server.address are supported.
As runtime I prefer netty, but I would be fine with tomcat as well.

Indeed, using the server.ssl.* configuration keys is the right way to go. This is not yet supported as of Spring Boot 2.0.0.M5, but it will be in a future Milestone version (you can follow issue #9431 for that).
You could use customizers as a workaround; Spring Boot provides a few of those for Tomcat already (see TomcatConnectorCustomizer), but unfortunately not yet for Netty (see #10418).
In the meantime, you can provide your own ReactiveWebServerFactory bean and manually set up your Netty server to do that.

Related

keycloak version to use with (react, spring boot, postgres)

what is the best version of keycloak to use with spring boot as backend and react as frontend and I can setup easily with a postgres database, I've tested the latest version 19.0.1 but I couldn't set it up with react and spring boot and it doesn't take the postgres DB I specified in env variables.
can you please suggest me the best version to use and some tutorials, videos or articles to learn more about it and how to implement it in production.
thanks in advance.
I recommand you don't use Keycloak Spring adapters, it is deprecated.
The latest Keycloak version works perfectly. Maybe you just misconfigured or use the wrong libs.
For client (react app), pick a library from certified list
For resource-server (Spring REST API), use either:
spring-boot-starter-oauth2-resource-server (but require quite some Java conf)
spring-addons-webmvc-jwt-resource-server (a lot is configurable from properties, including CORS and roles mapping)
Regarding the connection to Postgres, maybe should you return to the doc and read more carefully.
I'd recomend using the keycloak-spring-boot-starter.
Here is an article on how to set it up: https://www.baeldung.com/spring-boot-keycloak
I would also recomend to always use the most recent version. Especially for a security tool like keycloak. If it doesn't work with the tutorial just set it up in the version the tutorial references and then migrate to a newer version step by step using migration guides.

Does CXF 3.1.X uses Apache HttpComponents - HttpClient?

Does CXF 3.1.x really uses Apache HttpComponents - HttpClient for http transport? Maven dependencies does not list "Apache HttpComponents" as dependency nor do I see any HttpClient class in the CXF jars? However CXF JIRA CXF-6704 discusses about it?
I need access to HttpClient in CXF for NTLM support per connection basis which CXF by default relies on Java 6+ Authenticator which is set per JVM.
CXF has a decoupled runtime layer. Mostly they start with cxf-rt-*.
In the case of transports, cxf-rt-transports-*.
Take a look at this. I believe that this is the HTTP Components transport runtime.
EDIT: I think this is for asynchronous transport - (looked at the pom after I posted this).
EDIT2: I did a little more research on this and found this documentation. It says that the async client can be used for synchronous calls by setting use.async.http.conduit bus property to true. This also specifically refers to NTLM authentication.

Need to know the way to work with Apache Camel

I am new to Apache Camel. I have read several documentation of it and went through the examples (only of XML DSL) that Apache provide with its jar. I have a spring MVC project running over tomcat, and in the same project I need to include an Integration Framework. I have installed JBoss plugin for tooling so that I can drag and drop components but palette isn't showing any component but a message 'A palette is not working'. So, please suggest me how should I proceed to implement the same. For now I am referring Camel in Action. And, if possible, then provide an example to send a https request to any URL with some header parameters and transform its response and print it on console or write it to any file or give another https request to any other URL with the payload.
you mentioned that you installed the JBoss plugin for tooling, do you mean that you installed the JBoss Fuse Tooling?
Which version of Eclipse or JBoss Developer Studio are you using? Which OS are you using?
In Fuse Tooling, several examples are provided based on archetypes, I let you check the "CHAPTER 5. CREATING A NEW FUSE PROJECT" in
https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.2.1/pdf/Tooling_User_Guide/Red_Hat_JBoss_Fuse-6.2.1-Tooling_User_Guide-en-US.pdf

CXF Logging & cn:checks are ignored when used with <context:annotation-config />

The technologies I'm using are: Apache CXF, Spring 3.x, Struts 2.x and Hibernate 3.x
I'm facing a strange problem while TransactionManager with using Apache CXF. For my application I'm using CXF logging with my web-service and CN:checknames to ignore certificates on the server. When I deploy the application on server it works perfectly fine with logs being generated and certificates being ignored. But in the second step I'm developing a front-end for different areas of the application thus configuring annotation driven transaction manager in the application.xml. But when ever I try to use this line <context:annotation-config/> the CXF starts generating different logging scheme and CN:check is completely ignored.
Any help will be much appreciated. :)
My guess is your getting two instances of service/proxy bean constructed. It's hard to say without seeing your complete Spring configuration, especially any component scans. I suggest putting a log statement in it's constructor to see if it is the case. If so, ensure there is only one component scan active.

What is benefit of developing webservice using Apache CXF over normal JAX-WS with Java6

Can some body expalain what is the benefit of developing JAX-WS webservice using apache CXF over normal JAX-WS provided by Java 6.
JAX-WS is only the api / specification - to use it you need an implementation. It can be something like CXF, Axis or the one provided by the application server (JBoss, Weblogic et..).
One advantage of using CXF is that you have more flexibility in terms of deployment. It can be deployed in a web container or you can use an embedded web container and runt it as a stand alone application.
CXF also provides integration with other frameworks like spring.
It also provides tools to work with schema / WSDL etc..
Apache CXF is a open source webservice framework which contains JAX-WE and JAX-RS and also it helps to integrate with spring framework
CXF Supports
1) XML , JSON Format
2)JAXB Data Binding
3) SAOP ,REST,HTTP protocal binding
I have recently completed the web service implementation with JAX-WS using reference implementation apache-cxf. And I found with CXF - integration with Spring is very easy. Moreover, It provides various features like:
Customization of Logging features
Inbound and Outbound interceptor
Application Level security
Easy Exception handling using custom Fault.
For more detail, if you want, please checkout this link: http://predic8.com/axis2-cxf-jax-ws-comparison.htm
And, I read above link, its preety helpful for me.
Thanks !

Resources