How to configure password encryption into SwiftMQ running as Windows Service?

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to configure password encryption into SwiftMQ running as Windows Service?

Kelvin W
We recently install SwiftMQ 10.2 and was trying out the new feature password encryption described in this article:

http://www.swiftmq.com/products/router/swiftlets/sys_authentication/encryption/index.html

The article described the steps based on a Unix environment, as we are running on Windows environment may I know how can we enable encryption into SwiftMQ running as a Windows service?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to configure password encryption into SwiftMQ running as Windows Service?

IIT Software
Administrator
Concerning Jasypt you need to use encrypt.bat; rest is the same.

This needs to be set on the command line of the router:

-Dswiftmq.auth.encrypted.passwords=true

Please check smqr1.bat

Setting a environment var under Windows:

https://ss64.com/nt/set.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: How to configure password encryption into SwiftMQ running as Windows Service?

Kelvin W

Can we set this -Dswiftmq.auth.encrypted.passwords=true into the script installService.bat? So that the created Windows service will run with the encrypt password enabled.

 

Regards,
Kelvin

 

From: [hidden email]
Sent: Wednesday, July 12, 2017 6:55 PM
To: [hidden email]
Subject: Re: How to configure password encryption into SwiftMQ running as Windows Service?

 

Concerning Jasypt you need to use encrypt.bat; rest is the same.

This needs to be set on the command line of the router:

-Dswiftmq.auth.encrypted.passwords=true

Please check smqr1.bat

Setting a environment var under Windows:

https://ss64.com/nt/set.html

To unsubscribe from How to configure password encryption into SwiftMQ running as Windows Service?, click here.
NAML

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: How to configure password encryption into SwiftMQ running as Windows Service?

IIT Software
Administrator
You set this here:

JavaService.exe -install "%SWIFTMQ_SERVICENAME%" %JAVA_HOME%/jre/bin/server/jvm.dll -Xmx512M -Xbootclasspath/a:%SWIFTMQ_JARS% -Dswiftmq.auth.encrypted.passwords=true -start com.swiftmq.Router -params %SWIFTMQ_CONFIG_FILE% -stop

However, the problem is the master password. Our docs show how to set, start the router in background, and immediately clear it so that it is not written to disk.

In your case you'd certainly set the master password env var in the installService.bat. This is not save as it is written to disk.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: How to configure password encryption into SwiftMQ running as Windows Service?

Kelvin W
I set the installservice.bat as per suggested and install as windows service, when I try to start the SwiftMQ service it started and then stopped. I revert back the setting for installservice.bat and reinstall the SwiftMQ service, I hit same issue when try to start. Please advise what have I done incorrectly.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: How to configure password encryption into SwiftMQ running as Windows Service?

IIT Software
Administrator
What is in the log?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: How to configure password encryption into SwiftMQ running as Windows Service?

Kelvin W

There was not SwiftMQ logs generated.

 

Regards,
Kelvin

 

From: [hidden email]
Sent: Tuesday, July 18, 2017 5:52 PM
To: [hidden email]
Subject: RE: How to configure password encryption into SwiftMQ running as Windows Service?

 

What is in the log?

To unsubscribe from How to configure password encryption into SwiftMQ running as Windows Service?, click here.
NAML

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: How to configure password encryption into SwiftMQ running as Windows Service?

Kelvin W
In reply to this post by IIT Software

This is from Windows logs

 

The LoadLibrary function failed for the following reason: The specified module could not be found.

Could not load the Java Virtual Machine.

The SwiftMQ service failed to start.

 

Regards,
Kelvin

 

From: [hidden email]
Sent: Tuesday, July 18, 2017 5:52 PM
To: [hidden email]
Subject: RE: How to configure password encryption into SwiftMQ running as Windows Service?

 

What is in the log?

To unsubscribe from How to configure password encryption into SwiftMQ running as Windows Service?, click here.
NAML

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: How to configure password encryption into SwiftMQ running as Windows Service?

IIT Software
Administrator
In reply to this post by Kelvin W
Did you follow this HowTo?

Does it work without the -D for the encrypted passwords? If not, please check the JAVA_HOME if it is set to the correct path.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: How to configure password encryption into SwiftMQ running as Windows Service?

Kelvin W

Yes I did follow the steps to install the service. It does not work without the -D, and my JAVA_HOME is pointing to the right path. I did start up the router using smqr1_replicated.bat script with no problem.

 

Regards,
Kelvin

 

From: [hidden email]
Sent: Tuesday, July 18, 2017 6:30 PM
To: [hidden email]
Subject: RE: How to configure password encryption into SwiftMQ running as Windows Service?

 

Did you follow this HowTo?

Does it work without the -D for the encrypted passwords? If not, please check the JAVA_HOME if it is set to the correct path.

To unsubscribe from How to configure password encryption into SwiftMQ running as Windows Service?, click here.
NAML

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: How to configure password encryption into SwiftMQ running as Windows Service?

IIT Software
Administrator
Can you send me the installService.bat?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: How to configure password encryption into SwiftMQ running as Windows Service?

Kelvin W

 

 

Regards,
Kelvin

 

From: [hidden email]
Sent: Tuesday, July 18, 2017 8:31 PM
To: [hidden email]
Subject: RE: How to configure password encryption into SwiftMQ running as Windows Service?

 

Can you send me the installService.bat?

To unsubscribe from How to configure password encryption into SwiftMQ running as Windows Service?, click here.
NAML

 


installService.bat (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: How to configure password encryption into SwiftMQ running as Windows Service?

IIT Software
Administrator
I've got this from here:

Please change the command to:

JavaService.exe -install "%SWIFTMQ_SERVICENAME%" %JAVA_HOME%/jre/bin/server/jvm.dll -Xmx512M -Xbootclasspath/a:%SWIFTMQ_JARS% wrapper.java.additional.1=-Dswiftmq.auth.encrypted.passwords=true -start com.swiftmq.HARouter -params %SWIFTMQ_CONFIG_FILE% -out %STDOUT% -err %STDERR% -current %SWIFTMQ_WD%
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: How to configure password encryption into SwiftMQ running as Windows Service?

Kelvin W

Thank you for being so patient with me, really appreciate it. I have tried the below command and still not able to start windows service.

 

 

This is how I install the windows service, and the JAVA_HOME setting.

 

 

Regards,
Kelvin

 

From: [hidden email]
Sent: Tuesday, July 18, 2017 8:55 PM
To: [hidden email]
Subject: RE: How to configure password encryption into SwiftMQ running as Windows Service?

 

I've got this from here:

Please change the command to:

JavaService.exe -install "%SWIFTMQ_SERVICENAME%" %JAVA_HOME%/jre/bin/server/jvm.dll -Xmx512M -Xbootclasspath/a:%SWIFTMQ_JARS% wrapper.java.additional.1=-Dswiftmq.auth.encrypted.passwords=true -start com.swiftmq.HARouter -params %SWIFTMQ_CONFIG_FILE% -out %STDOUT% -err %STDERR% -current %SWIFTMQ_WD%

To unsubscribe from How to configure password encryption into SwiftMQ running as Windows Service?, click here.
NAML

 


installService.bat (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: How to configure password encryption into SwiftMQ running as Windows Service?

IIT Software
Administrator
I've just tried to install it here with the installService.bat and the property set and it works. The error you get seems to me something with the JVM.

Under log/routername are some log files, stdout, stderr etc. Can you check them?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: How to configure password encryption into SwiftMQ running as Windows Service?

Kelvin W

I look in the log folder, there is no stderr nor stdout files, I attached the info.log here.

 

Regards,
Kelvin

 

From: [hidden email]
Sent: Wednesday, July 19, 2017 3:10 PM
To: [hidden email]
Subject: RE: How to configure password encryption into SwiftMQ running as Windows Service?

 

I've just tried to install it here with the installService.bat and the property set and it works. The error you get seems to me something with the JVM.

Under log/routername are some log files, stdout, stderr etc. Can you check them?

To unsubscribe from How to configure password encryption into SwiftMQ running as Windows Service?, click here.
NAML

 


info.log (10K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: How to configure password encryption into SwiftMQ running as Windows Service?

IIT Software
Administrator
So I tested it again with SwiftMQ HA Router. I've used the attached installService.bat. The only changes I made is to set the -Dswiftmq.auth.encrypted.passwords=true and to put the working directory in "".

It works as expected. The logs (attached) are in log/instance1. File service-stderr.log contains a message to set the master password. This is expected and up to you to define it.

Once you have installed and started it, HA instance1 is running and waits for negotiation. You have to manually start smqr2_replicated.bat to connect to instance1. Then stop smqr2_replicated.bat to force instance1 (the service) to go into STANDALONE. Then you should see the message in service-stderr.log.

installService.bat
service-stderr.log
service-stdout.log
Loading...