spring jpa application.properties 사용SSL
로컬 mysql 데이터베이스에서 SSL을 끄려고 합니다.그러나 springapplication.properties 파일에서 이 작업을 수행할 실제 속성을 찾을 수 없습니다.
현재 파일:
# ===============================
# = DATA SOURCE
# ===============================
# Set here configurations for the database connection
# Connection url for the database "test"
spring.datasource.url = jdbc:mysql://localhost:3306/test
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
# Username and password
spring.datasource.username = root
spring.datasource.password = blah
# Keep the connection alive if idle for a long time (needed in production)
spring.datasource.testWhileIdle = true
spring.datasource.validationQuery = SELECT 1
# ===============================
# = JPA / HIBERNATE
# ===============================
# Use spring.jpa.properties.* for Hibernate native properties (the prefix is
# stripped before adding them to the entity manager).
# Show or not log for each sql query
spring.jpa.show-sql = true
# Hibernate ddl auto (create, create-drop, update): with "update" the database
# schema will be automatically updated accordingly to java entities found in
# the project
spring.jpa.hibernate.ddl-auto = update
# Naming strategy
spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy
# Allows Hibernate to generate SQL optimized for a particular DBMS
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
난 시도했다.spring.datasource.useSSl=false그리고 그것은 작동하지 않습니다.저도 노력했습니다.spring.datasource.url = jdbc:mysql://localhost:3306/test&useSSL=false
다음과 같은 문제를 해결했습니다.
jdbc:mysql://localhost:3306/test?verifyServerCertificate=false&useSSL=false&requireSSL=false
'&' 대신 '?'를 사용해야 하는 거 아닙니까?
이것은 너의 것이다.
spring.datasource.url =jdbc:mysql://localhost:3306/test&useSSL=false
내 말은
spring.datasource.url = jdbc:mysql://localhost:3306/test?useSSL=false
저는 오염시키는 것을 좋아하지 않습니다.java어떤 경우에도 응용프로그램 컨테이너에서 쓸모없는 옵션 또는 시스템 속성...
다음을 사용하여 MySQL 연결에 대한 SSL 인증서를 프로그래밍 방식으로 설정할 수 있습니다.
jdbc:http://example.com:3306/MYDB?verifyServerCertificate=true&useSSL=true&requireSSL=true&clientCertificateKeyStoreUrl=file:cert/keystore.jks&clientCertificateKeyStorePassword=123456&trustCertificateKeyStoreUrl=file:cert/truststore.jks&trustCertificateKeyStorePassword=123456
문서화되어 있습니다.
- https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-reference-configuration-properties.html
- https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-reference-using-ssl.html
여전히 찾고 있다면 다음과 같은 대답이 있습니다.
데이터 소스 URL 쿼리 매개 변수를 application.properties로 추가하는 방법은 무엇입니까?
spring.datasource.hikari.data-source-properties.useSSL=false
언급URL : https://stackoverflow.com/questions/35576994/spring-jpa-application-properties-usessl
'programing' 카테고리의 다른 글
| Mongo 업데이트 어레이 요소(.NET 드라이버 2.0) (0) | 2023.06.19 |
|---|---|
| 커밋이 처음 생성된 GitHub에서 꺼내기 요청 찾기 (0) | 2023.06.19 |
| SSMS 결과 그리드 - CRLF가 복사/붙여넣기로 보존되지 않음 - 더 나은 기술이 있습니까? (0) | 2023.06.19 |
| 문서의 특정 부분 가져오기 (0) | 2023.06.19 |
| 루비 연산자 "=~" (0) | 2023.06.19 |