Skip to content

Commit

Permalink
Fix SSL certificate location
Browse files Browse the repository at this point in the history
  • Loading branch information
mnapoli committed Oct 17, 2023
1 parent e4ed5f0 commit 78b79c3
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions php-80/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ RUN php /bref/lib-copy/copy-dependencies.php /bref-layer/bref/extensions/opcache
RUN php /bref/lib-copy/copy-dependencies.php /bref-layer/bref/extensions/pdo_mysql.so /bref-layer/lib
RUN php /bref/lib-copy/copy-dependencies.php /bref-layer/bref/extensions/pdo_pgsql.so /bref-layer/lib

# Copy the OpenSSL certificates file
RUN cp /etc/ssl/cert.pem /bref-layer/bref/ssl/cert.pem
# Create a symbolic link to the OpenSSL certificates file for BC purposes
RUN ln -s /etc/ssl/cert.pem /bref-layer/bref/ssl/cert.pem


# ---------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions php-81/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ RUN php /bref/lib-copy/copy-dependencies.php /bref-layer/bref/extensions/opcache
RUN php /bref/lib-copy/copy-dependencies.php /bref-layer/bref/extensions/pdo_mysql.so /bref-layer/lib
RUN php /bref/lib-copy/copy-dependencies.php /bref-layer/bref/extensions/pdo_pgsql.so /bref-layer/lib

# Copy the OpenSSL certificates file
RUN cp /etc/ssl/cert.pem /bref-layer/bref/ssl/cert.pem
# Create a symbolic link to the OpenSSL certificates file for BC purposes
RUN ln -s /etc/ssl/cert.pem /bref-layer/bref/ssl/cert.pem


# ---------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions php-82/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ RUN php /bref/lib-copy/copy-dependencies.php /bref-layer/bref/extensions/opcache
RUN php /bref/lib-copy/copy-dependencies.php /bref-layer/bref/extensions/pdo_mysql.so /bref-layer/lib
RUN php /bref/lib-copy/copy-dependencies.php /bref-layer/bref/extensions/pdo_pgsql.so /bref-layer/lib

# Copy the OpenSSL certificates file
RUN cp /etc/ssl/cert.pem /bref-layer/bref/ssl/cert.pem
# Create a symbolic link to the OpenSSL certificates file for BC purposes
RUN ln -s /etc/ssl/cert.pem /bref-layer/bref/ssl/cert.pem


# ---------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions php-83/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ RUN php /bref/lib-copy/copy-dependencies.php /bref-layer/bref/extensions/opcache
RUN php /bref/lib-copy/copy-dependencies.php /bref-layer/bref/extensions/pdo_mysql.so /bref-layer/lib
RUN php /bref/lib-copy/copy-dependencies.php /bref-layer/bref/extensions/pdo_pgsql.so /bref-layer/lib

# Copy the OpenSSL certificates file
RUN cp /etc/ssl/cert.pem /bref-layer/bref/ssl/cert.pem
# Create a symbolic link to the OpenSSL certificates file for BC purposes
RUN ln -s /etc/ssl/cert.pem /bref-layer/bref/ssl/cert.pem


# ---------------------------------------------------------------
Expand Down
6 changes: 4 additions & 2 deletions tests/test_2_extensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,10 @@
// Check that the default certificate file exists
// https://github.com/brefphp/aws-lambda-layers/issues/53
'curl-openssl-certificates' => file_exists(openssl_get_cert_locations()['default_cert_file']),
// Check its location has not changed (would be a breaking change)
'curl-openssl-certificates-location' => openssl_get_cert_locations()['default_cert_file'] === '/opt/bref/ssl/cert.pem',
// Check its location
'curl-openssl-certificates-location' => openssl_get_cert_locations()['default_cert_file'] === '/etc/pki/tls/cert.pem',
// Check the file in previous Bref versions is still here (would be a breaking change)
'curl-openssl-certificates-backwards-compatibility' => file_exists('/opt/bref/ssl/cert.pem'),
'json' => function_exists('json_encode'),
'bcmath' => function_exists('bcadd'),
'ctype' => function_exists('ctype_digit'),
Expand Down

0 comments on commit 78b79c3

Please sign in to comment.