mysql - 将docker中的WSO2 apim连接到本地机器中的mysql时在url中使用useSSL = true时出现错误

标签 mysql docker wso2 wso2-api-manager

当在 url 中使用 ssl=true 将 docker 中的 WSO2 apim 连接到本地机器中的 mysql 时出现错误。

apim中的数据源连接代码:

<datasource>
            <name>WSO2_CARBON_DB</name>
            <description>The datasource used for registry and user manager</description>
            <jndiConfig>
                <name>jdbc/WSO2CarbonDB</name>
            </jndiConfig>
            <definition type="RDBMS">
                <configuration>
                    <url>jdbc:mysql://host.docker.internal:3306/carbon_db?serverTimezone=UTC&amp;useSSL=true</url>
                    <username>userame</username>
                    <password>password</password>
                    <driverClassName>com.mysql.cj.jdbc.Driver</driverClassName>
                    <maxActive>50</maxActive>
                    <maxWait>60000</maxWait>
                    <testOnBorrow>true</testOnBorrow>
                    <validationQuery>SELECT 1</validationQuery>
                    <validationInterval>30000</validationInterval>
                    <defaultAutoCommit>true</defaultAutoCommit>
                </configuration>
            </definition>
        </datasource>

当 useSSL=false 时它工作正常。 useSSL= true 给出以下连接失败错误:

 wso2am_1     | [2019-05-06 07:37:25,095] ERROR - TransactionManager Failed to start new registry transaction.
    wso2am_1     | com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

Mysql服务器是8.0,ssl变量如下: enter image description here

最佳答案

请尝试使用 requireSSL=true

关于mysql - 将docker中的WSO2 apim连接到本地机器中的mysql时在url中使用useSSL = true时出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56001302/

相关文章:

node.js - Docker 化 Node.js 应用程序时的 EADDRNOTAVAIL

java - 当前使用 WSO2 Identity Server API 的示例

wso2 - 如何从 ESB 调用 DSS 服务 - 我觉得我已经很接近了,我只需要一点点

spring-mvc - 在 WSO2 应用服务器中部署 Spring MVC

php - httpPost 发布应用程序数据的 url

mysql - 比较数据库技术

php - 如何在mysql表中插入具有默认值的行

mysql - SQL 查询 (MAX-MIN) 显示错误结果

docker - Rust musl Docker 镜像找不到 Cargo

image - 使 Docker 镜像相互通信