java - Access SSL-Parameters in connections via Hibernate -
i using hibernate java application uses sessionfactory create connections , sessions. using postgresql database pass proper jdbc connectionstring build sessionfactory , sessions afterwards. thing im able access jdbc4connection.
how able read ciphersuite used within secured connection, ssl protocol used etc?
here how initialize sessionfactory:
configuration configuration = new configuration(); properties p = configuration.getproperties(); p.setproperty("hibernate.connection.url","jdbc:postgresql://127.0.0.1:5432/postgres?ssl=true&sslfactory=org.postgresql.ssl.nonvalidatingfactory"); p.setproperty("hibernate.connection.username", "myusername"); p.setproperty("hibernate.connection.password", "mypassword"); p.setproperty("hibernate.connection.driver_class", "org.postgresql.driver"); p.setproperty("hibernate.dialect", "org.hibernate.dialect.postgresqldialect"); serviceregistry serviceregistrywebonkys = new standardserviceregistrybuilder() .applysettings(p).build(); sessionfactory sessionfactory = configuration .buildsessionfactory(serviceregistrywebonkys);
if can find out how via regular jdbc (i don't know how it's done), can same thing hibernate.
session.dowork(new work() { @override public void execute(connection connection) throws sqlexception { // access connection here , perform regular jdbc operations. } });
this had when had set oracle specific properties set on "oracleconnection.java" instances.
oracle.jdbc.driver.oracleconnection oc = (oracle.jdbc.driver.oracleconnection) connection.getmetadata().getconnection()
Comments
Post a Comment