netty-ssl | 这个项目主要是 netty 利用 SSL 做身份认证的例子: myCa | Websocket library
kandi X-RAY | netty-ssl Summary
kandi X-RAY | netty-ssl Summary
这个项目主要是 netty 利用 SSL 做身份认证的例子: myCa.zip 是我代码中使用的证书,可解压放在 /home 下. 利用 openssl 自建证书体系 可以参考下面文档 解决 netty 不支持rsa key的问题
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Creates a server
- Creates the ssl context
- Get input stream from file
- Closes the given InputStream
- Start the client
- Connect to the client
- Creates a client ssl context
- Initialize the socket channel
- Init socket channel
- Initializes the channel to be active
- Bind the principal to the channel
- Initializes the channel
- Send a message
- Handle exception
netty-ssl Key Features
netty-ssl Examples and Code Snippets
Community Discussions
Trending Discussions on netty-ssl
QUESTION
I have ActiveMQ Artemis 2.8.1 running and get the following error when I try to connect to it using a Spring Boot application over SSL.
...ANSWER
Answered 2022-Feb-04 at 16:40There is definitely a problem with your configuration. The error message even says so:
QUESTION
I'm using JMS on a Spring boot client to connect to an ActiveMQ Artemis broker over SSL. The client is able to connect regardless of the validity of the certificates in the truststore and even if invalid credentials are used. How do I ensure that the broker is filtering clients out based on the configured parameters?
The acceptors
in the broker.xml
are defined as show below. The SSL acceptor uses port 61617
.
ANSWER
Answered 2021-Oct-14 at 14:36Here's what got things working.
Firstly, the login.config
file on Artemis has a GuestLoginModule
that this link says is chained to the PropertiesLoginModule
and the guest module allows clients without credentials, or even invalid credentials to connect to the broker. Now, by default, the GuestLoginModule
looks like this
QUESTION
I'm using ActiveMQ Artemis 2.18.0 and version 2.5.5 of the spring-boot-starter-artemis
dependency on a Spring Boot client. In my use case clients are required to communicate with each other via topics. The issue is that the string jms.topic.
is getting prefixed to every topic defined on the client. For example the topic foo.sendInfo
becomes jms.topic.foo.sendInfo
.
The broker.xml
file is as shown below. The acceptor
used by the Spring Boot client is the netty-ssl-acceptor
on port 61617
.
ANSWER
Answered 2021-Oct-13 at 08:24You have defined "anycastPrefix=jms.queue;multicastPrefix=jms.topic." in your SSL acceptor. You should remove them. Another solution is to setEnableAmq1Prefix to false on your connection factory (but i think this is the default value)
QUESTION
There is not much information that I've found in terms of configuration with Netty and Webflux using HTTP2.
I have used similiar configurations in the past without using reactor based spring boot modules, typically spring boot web. I have posted my steps below.
The problem is SSL not working correctly with Netty. Do I require more work in terms of setup? Hoping to get some pointers or examples to understand how to confiure this correctly please.
Generated Certificate
generate cert valid for local dev usage:
mkcert localhost 127.0.0.1
output: certificate
localhost+1.pem
keylocalhost+1-key.pem
generate keystore with openssl:
openssl pkcs12 -export -in localhost+1.pem -inkey localhost+1-key.pem -out keystore.p12 -name localdev
Application Files
application.yaml
ANSWER
Answered 2021-Feb-20 at 19:32Your application.yml file is incorrect. The ssl properties are effectively at server.server.ssl instead of server.ssl. Therefore the SSL settings have no effect and your server is an HTTP server instead of an HTTPS server. That's why curl works with http.
To fix, remove line 6 (server:) and back indent line "ssl:" and following. This will give you (for example) server.ssl.enabled=true instead of server.server.ssl.enabled=true
QUESTION
We're using ActiveMQ Artemis 2.8.1 with MQTT.
We integrated ActiveMQ Artemis with Wildfly. Consider our server connects using client id SAM
on 50 topics. On checking Artemis with JConsole we can see that each client subscription results in a queue whose name follows the pattern _
. In my case consider topic as com/api/output
which means the subscription queue name will be SAM_com/api/output
. Likewise there will be 50 other subscription queues using the same naming pattern (i.e. SAM_
).
My findings
Based on my research each queue is used to store messages sent to that topic for each client's subscription. For example, when the same topic (e.g 1/2/3
) is subscribed to by 3 different clients (e.g A
,B
,& C
) then there will be 3 subscription queues (i.e. A_1/2/3
, B_1/2/3
, & C_1/2/3
). Therefore when a message is sent to the topic 1/2/3
Artemis will put that messages in the subscription queues A_1/2/3
,B_1/2/3
, C_1/2/3
.
Actual problem
Now same client wants to connect to broker with different client id now (e.g. TOM
). My Client initiates connection drop and Artemis also recognizes connection drop, then my client connects to broker with new client id (TOM
) for the same 50 topics. Now there will be 100 subscription queue total with each topic having 2 (i.e. one for each clientid - SAM
& TOM
). I find the reason that SAM
queues are maintained because while initiating the connection we use cleanSession
as false
. So all those subscription queues will be durable, hence the queues are maintained even if the client is disconnected.
When a message is sent to the topic it will be put in two queues (SAM
& TOM
). Our client is connected to broker with client id TOM
so the TOM
queue has consumer which results in all the TOM
queue messages being consumed by the client. However, the SAM
queue accumulates messages and eats up all JVM's heapspace until the server dies.
The purpose of durable queues is to maintain the message even when the client disconnects, but is there any way to tell ActiveMQ Artemis to purge the client's queues and messages if client doesn't show up for certain time period or to purge the messages from the client's subscription queue when client drops the connection?
Our broker.xml
...ANSWER
Answered 2021-Jan-11 at 15:46It's really up to the subscriber to delete its subscription when it is done with it. In other words, the MQTT client should unsubscribe the existing subscriber before creating a new one. The broker has no way to know whether or not the subscriber plans to reconnect later to fetch the messages from its subscription.
If you really want the broker to delete the subscription queue you can use the following address-settings:
: This must be
true
.: This is the delay (in milliseconds) from the time the last consumer disconnects until the broker deletes the subscription queue.
: This must be
-1
in order to ignore any messages in the subscription queue.
To be clear, I would recommend against this configuration as the broker may inadvertently delete legitimate messages. For example, if a subscriber mistakenly disconnects (e.g. due to a network failure, hardware failure, JVM crash, etc.) for longer than the configured then the broker will delete its subscription queue and all the subscriber's messages will effectively be lost.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install netty-ssl
You can use netty-ssl like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the netty-ssl component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page