cancel
Showing results for 
Search instead for 
Did you mean: 

SAP CP Neo: How to configure Java application to use encrypted connection to a HANA

former_member186905
Participant
0 Kudos

Hi all,

I'm currently developing a SAP CP Neo-hosted Java application. The application connects to a HANA instance in the Neo account, using JNDI lookup and the default datasource binding.

In more detail, on the application Data Source Bindings tab I have a binding for the data source <DEFAULT>. In the Java code I get hold of a DataSource using
new JndiDataSourceLookup().getDataSource("jdbc/DefaultDB");

According to the SAP HANA JDBC Connection Properties documentation (https://help.sap.com/viewer/0eec0d68141541d1b07893a39944924e/1.0.12/en-US/109397c2206a4ab2a5386d494f4cf75e.html) the HANA JDBC driver supports encrypted connections with the "encrypt" parameter.

My question now is: how can I set this JDBC property?

There seems to be no way to configure this in the Neo Data Source Bindings tab. Do I have to unwrap the DataSource to the HANA-specific one provided by the HANA JDBC driver? Is there any other way?

Thanks a lot for your help!

Kind regards,
Valentin

Accepted Solutions (1)

Accepted Solutions (1)

Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert

Hi Valentim,

I believe this is not supported out-of-the box on SCP. To enable this feature one would need to have direct access to the database operating system (according to SAP Note 1718944). And this is really not something that customers are allowed to do. To get a straight forward answer on this I suggest opening an Incident/Ticket on SAP Support Channel and ask them about viability of this setting. If this is supported and they have configured for your database, then I would encourage you to check SAP Note 2487698. It show how to enable SSL connection from a Java application's perspective - such as Eclipse (HANA Studio) - to a HANA DB. However, I believe this was intended for databases running locally (LAN). In the case of Neo, all access is done either by applications locally (in the context of the cloud) or via secure tunnel (Cloud Connector). I can't really see a plausible reason to enforce SSL communication in cloud scenarios whereas nothing else is running besides your application and the database.

Also, I encourage you to access your database using Eclipselink/JPA - please check this tutorials. Try to set the parameter "encrypt" to true in a Hash Map just like in the init method of the how-to exercise. The connection will be managed by EclipseLink and you may try the following:

properties.put("eclipselink.jdbc.property.encrypt", true);

NOTE: I have never tried this before. So please try it on your own and let us know if it worked or not.

Regards,
Ivan

Answers (0)