AmadeusITGroup / HttpSessionReplacer

Store JEE Servlet HttpSessions in Redis
MIT License
49 stars 33 forks source link

Question - Is there is a way to provide Redis password? #53

Closed dinbtechit closed 4 years ago

dinbtechit commented 4 years ago

First of all want to appreciate your great work! hats off!

Question... We are using a cloud-based Redis instance, is there a way to supply a password?

dinbtechit commented 4 years ago

I had to make some code changes to pass in the password and enable SSL. If you are accessing the Redis instance in Azure or AWS, password is mandatory and obviously you will need SSL enabled as well.

Modified following File to get it working:

  1. RedisConfiguration.java
  2. JedisSessionRepositoryFactory.java

Added the following configuration parameters:

JAVA_OPTS:

-Dcom.amadeus.session.redis.password=password
-Dcom.amadeus.session.redis.ssl=true | false

or if you're using context param in web.xml

<context-param>
      <param-name>com.amadeus.session.redis.password</param-name>
      <param-value>========PASSWORD========</param-value>
</context-param>
 <context-param>
       <param-name>com.amadeus.session.redis.ssl</param-name>
       <param-value>true</param-value>
</context-param>

I would more than happy to make that change for you. But let me know if you want me to submit a PR for this.

nbogojevic commented 4 years ago

Hi @dinbtechit,

Yes, please do submit a PR. It's great idea.

Nenad

dinbtechit commented 4 years ago

Submitted Pull request. https://github.com/AmadeusITGroup/HttpSessionReplacer/pull/54