Mysql database connection (programmatically) with ca.pem, cert.pem, and key.pem

조회 수: 8 (최근 30일)
tree317
tree317 2025년 8월 27일
편집: tree317 2025년 8월 27일
Hello,
I am trying to connect to a remote database (programmatically) via a java connection (mysql-connector-j-XXX) that requires an ssl certificate.
The connection is a programmatic connection
I cannot find the correct parameters for the certifcate components
ie. ca.pem
ie. client-cert.pem
ie. client-key.pem
I would sincerely appreciate an example (see: unknown_xx_param below) as I cannot locate documentation for these within the matlab manual.
or within the community forum. The closest post I can find is [ here ].
The method I am implementing takes the following form
vendor = 'MySql';
user = 'my_username';
password = 'my_password';
host = 'my_host';
port = 3306;
ca_file = '/path/ca.pem';
client_cert_file = '/path/client-cert.pem';
client_key_file = '/path/client-key.pem';
sql = '?verifyServerCertificate=true&useSSL=true&requireSSL=true&allowPublicKeyRetrieval=true&useUnicode=yes&characterEncoding=utf-8&character-set-server=utf8mb4&collation-server=utf8mb4_0900_ai_ci&use_pure=True';
conn = database(...
sql, ...
user, ...
password, ...
'Vendor', vendor, ...
'Server', host, ...
'Port', port, ...
'unknown_ca_param', ca_file, ...
'unknown_cert_param', client_cert_file, ...
'unknonw_key_param', client_key_file ...
);
The error type generated by numerous incorrect parameter attemts is:
Unmatched parameter name XXX must be a string scalar or character vector that can represent a field name.
Many thanks in advance.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Database Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by