Skip to content

Commit

Permalink
Merge pull request #56 from brefphp/ssl-certs
Browse files Browse the repository at this point in the history
  • Loading branch information
mnapoli committed Feb 14, 2023
2 parents c5e9080 + ab80b8a commit b353a8e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
6 changes: 5 additions & 1 deletion php-80/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,8 @@ RUN pecl install APCu
# Now we copy everything we need for the layers into /bref-layer (which will be used for the real /opt later)
RUN mkdir -p /bref-layer/bin \
&& mkdir -p /bref-layer/lib \
&& mkdir -p /bref-layer/bref/extensions
&& mkdir -p /bref-layer/bref/extensions \
&& mkdir -p /bref-layer/ssl

# Copy the PHP binary
RUN cp ${INSTALL_DIR}/bin/php /bref-layer/bin/php && chmod +x /bref-layer/bin/php
Expand All @@ -436,6 +437,9 @@ 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 ${CA_BUNDLE} /bref-layer/ssl/cert.pem


# ---------------------------------------------------------------
# Start from a clean image to copy only the files we need
Expand Down
6 changes: 5 additions & 1 deletion php-81/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,8 @@ RUN pecl install APCu
# Now we copy everything we need for the layers into /bref-layer (which will be used for the real /opt later)
RUN mkdir -p /bref-layer/bin \
&& mkdir -p /bref-layer/lib \
&& mkdir -p /bref-layer/bref/extensions
&& mkdir -p /bref-layer/bref/extensions \
&& mkdir -p /bref-layer/ssl

# Copy the PHP binary
RUN cp ${INSTALL_DIR}/bin/php /bref-layer/bin/php && chmod +x /bref-layer/bin/php
Expand All @@ -436,6 +437,9 @@ 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 ${CA_BUNDLE} /bref-layer/ssl/cert.pem


# ---------------------------------------------------------------
# Start from a clean image to copy only the files we need
Expand Down
6 changes: 5 additions & 1 deletion php-82/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,8 @@ RUN pecl install APCu
# Now we copy everything we need for the layers into /bref-layer (which will be used for the real /opt later)
RUN mkdir -p /bref-layer/bin \
&& mkdir -p /bref-layer/lib \
&& mkdir -p /bref-layer/bref/extensions
&& mkdir -p /bref-layer/bref/extensions \
&& mkdir -p /bref-layer/ssl

# Copy the PHP binary
RUN cp ${INSTALL_DIR}/bin/php /bref-layer/bin/php && chmod +x /bref-layer/bin/php
Expand All @@ -436,6 +437,9 @@ 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 ${CA_BUNDLE} /bref-layer/ssl/cert.pem


# ---------------------------------------------------------------
# Start from a clean image to copy only the files we need
Expand Down
3 changes: 3 additions & 0 deletions tests/test_2_extensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@
'curl-http2' => defined('CURL_HTTP_VERSION_2'),
// Make sure we are not using the default AL2 OpenSSL version (7.79)
'curl-openssl' => str_starts_with(curl_version()['ssl_version'], 'OpenSSL/1.1.1'),
// 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']),
// Make sure we are using curl with our compiled libssh
'curl-libssh' => version_compare(str_replace('libssh2/', '', curl_version()['libssh_version']), '1.10.0', '>='),
'json' => function_exists('json_encode'),
Expand Down

0 comments on commit b353a8e

Please sign in to comment.