Files
bun.sh/test/js/sql/mysql-tls/Dockerfile
Ciro Spaciari b79bbfe289 fix(Bun.SQL) fix SSLRequest (#22378)
### What does this PR do?
Fixes https://github.com/oven-sh/bun/issues/22312
Fixes https://github.com/oven-sh/bun/issues/22313

The correct flow for TLS handshaking is:

Server sending
[Protocol::Handshake](https://dev.mysql.com/doc/dev/mysql-server/8.4.5/page_protocol_connection_phase_packets_protocol_handshake.html)
Client replying with
[Protocol::SSLRequest:](https://dev.mysql.com/doc/dev/mysql-server/8.4.5/page_protocol_connection_phase_packets_protocol_ssl_request.html)
The usual SSL exchange leading to establishing SSL connection
Client sends
[Protocol::HandshakeResponse:](https://dev.mysql.com/doc/dev/mysql-server/8.4.5/page_protocol_connection_phase_packets_protocol_handshake_response.html)

<img width="460" height="305" alt="Screenshot 2025-09-03 at 15 02 25"
src="https://github.com/user-attachments/assets/091bbc54-75bc-44ac-98b8-5996e8d69ed8"
/>

Source:
https://dev.mysql.com/doc/dev/mysql-server/8.4.5/page_protocol_connection_phase.html

### How did you verify your code works?
Tests

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-09-03 18:59:15 -07:00

22 lines
643 B
Docker

# Dockerfile
ARG MYSQL_VERSION=8.4
FROM mysql:${MYSQL_VERSION}
# Copy TLS materials + config
# Expect these in the build context:
# ssl/ca.pem
# ssl/server-cert.pem
# ssl/server-key.pem
# conf.d/ssl.cnf
COPY ssl /etc/mysql/ssl
COPY conf.d /etc/mysql/conf.d
# Lock down permissions so mysqld accepts the key
# The official image runs mysqld as user "mysql"
RUN chown -R mysql:mysql /etc/mysql/ssl /etc/mysql/conf.d \
&& chmod 600 /etc/mysql/ssl/server-key.pem \
&& find /etc/mysql/ssl -type f -name "*.pem" -exec chmod 640 {} \; \
&& echo "require_secure_transport=ON" >> /etc/mysql/conf.d/force_tls.cnf
# Expose MySQL
EXPOSE 3306