Monday, 8 May 2023

ssl connection from hana studio to sap hana DB

After activating the sslenforce parameter in the hanadatabase, our attempts to connect to the hana database via hana studio were unsuccessful due to an “only secured connections are allowed” error. Here is one of the methods we employed to establish a secure connection with the hana database.

Here are the steps we followed to establish a connection from SAP Hana Studio to the HANA DB.

1. Export the Hana server certificate using sapgenpse as per note 2475246.

SAP HANA, SAP HANA Exam, SAP HANA Exam Prep, SAP HANA Career, SAP HANA Tutorial and Materials, SAP HANA Learning

2. On the local windows machine, locate the Java home. Goto hana studio à help about hana studio àInstallation details and locate java.home.

SAP HANA, SAP HANA Exam, SAP HANA Exam Prep, SAP HANA Career, SAP HANA Tutorial and Materials, SAP HANA Learning

Navigate to $Java_home\bin

SAP HANA, SAP HANA Exam, SAP HANA Exam Prep, SAP HANA Career, SAP HANA Tutorial and Materials, SAP HANA Learning

3. Execute the below command to create a keystore.
keytool.exe -genkey -keystore “C:\Temp\certificates\.keystore” -keyalg RSA -dName “CN=Firstname Lastname, OU=HANA, O=SAP, C=DE” -alias local

SAP HANA, SAP HANA Exam, SAP HANA Exam Prep, SAP HANA Career, SAP HANA Tutorial and Materials, SAP HANA Learning

4. Import the certificate into the keystore which was exported earlier in step 1 with below command.

keytool -v -importcert -alias hana<sid> -file “C:\Temp\certificates\sapsid.crt” -keypass password -keystore .keystore -storepass password

SAP HANA, SAP HANA Exam, SAP HANA Exam Prep, SAP HANA Career, SAP HANA Tutorial and Materials, SAP HANA Learning
import the cert

5. To list the certificates in the keystore execute the below command.
keytool -v -list -keystore C:\Program Files\sap\hdbstudio\plugins\com.sap.ide.sapjvm.jre.win32.x86_64_110.8.0\jre\bin\.keystore

6. The keystore file will be generated in same $JAVA_HOME\bin directory. Copy the .keystore file to some temp directory for easy navigation.

7. In the hana studio connect using ssl. Browse the keystore and provide the password.

SAP HANA, SAP HANA Exam, SAP HANA Exam Prep, SAP HANA Career, SAP HANA Tutorial and Materials, SAP HANA Learning

SAP HANA, SAP HANA Exam, SAP HANA Exam Prep, SAP HANA Career, SAP HANA Tutorial and Materials, SAP HANA Learning

8. We should be able to connect via SSL now. To confirm that we can see the lock symbol in the connections

SAP HANA, SAP HANA Exam, SAP HANA Exam Prep, SAP HANA Career, SAP HANA Tutorial and Materials, SAP HANA Learning

Numerous blogs provide guidance on establishing SSL connectivity to Hana Database, and the following is one of the suggested methods. Any suggestions or feedback for improvements are greatly appreciated. Feel free to share your thoughts at the end of the blog post.

No comments:

Post a Comment