I have an Oracle 19c database setup in AWS RDS. To connect to it from my local computer, I need to create an SSH tunnel like this:
ssh -N -i ~/rsa_key -L 127.0.0.1:1522:db-dev.gc.net:1522 [email protected]
From here, I use the following jdbc connection to connect to my dev db:
jdbc:oracle:thin:@127.0.0.1:1522:DV
When I do that from DataGrip it works just fine:
But I need to connect to this db from my locally running Spring Boot Java 11 application where I am getting the following error:
ERROR restartedMain c.z.h.p.HikariPool:594 – HikariPool-2 – Exception during pool initialization.
java.sql.SQLException: ORA-01017: invalid username/password; logon denied
I am literally copy and pasting the exact same username/password into both DataGrip and in my code.
Here are the details from various project files:
build.gradle
dependencies {
api 'com.oracle.database.jdbc:ojdbc11:21.1.0.0'
testImplementation 'com.h2database:h2'
testImplementation "org.springframework.security:spring-security-test:5.1.3.RELEASE"
}
application.yml
core:
datasource:
driverClassName: oracle.jdbc.OracleDriver
jdbc-url: jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1522))(CONNECT_DATA=(SERVER=DEDICATED)(SID=DV)))
username: dbuser
password: dbpassword
platform: oracle
dialect: org.hibernate.dialect.Oracle10gDialect
I have checked the db parameters
NAME TYPE VALUE
------------------------ -------- ------------------------------
sec_case_sensitive_logon boolean TRUE
I have checked the users in the DBA_USERS
table
[
{
"USERNAME": "dbuser",
"USER_ID": 21,
"PASSWORD": null,
"ACCOUNT_STATUS": "OPEN",
"LOCK_DATE": null,
"EXPIRY_DATE": null,
"PASSWORD_VERSIONS": "11G 12C ",
"EDITIONS_ENABLED": "N",
"AUTHENTICATION_TYPE": "PASSWORD"
}
]
My question is, is there any way to have the ssh tunnel log the credentials being passed, or use wireshark to monitor the credentials being sent through the tunnel OR view Oracle db logs in AWS that can show the username/password being used to authenticate?
My guess is that the jdbc driver in the Spring Boot app is somehow manipulating the provided password in the application.yml
file before sending it, e.g.; upper or lower casing it.
Have setup wireshark to listen in on tcp.dstport == 1522 but unable to see any credentials being logged that I can use to validate.