Rotating your SSL/TLS certificate
As of March 5, 2020, Amazon RDS CA-2015 certificates have expired. If you use or plan to use Secure Sockets Layer (SSL) or Transport Layer Security (TLS) with certificate verification to connect to your RDS DB instances, you require Amazon RDS CA-2019 certificates, which are enabled by default for new DB instances. If you currently do not use SSL/TLS with certificate verification, you might still have expired CA-2015 certificates and must update them to CA-2019 certificates if you plan to use SSL/TLS with certificate verification to connect to your RDS databases.
Follow these instructions to complete your updates. Before you update your DB instances to use the new CA certificate, make sure that you update your clients or applications connecting to your RDS databases.
Amazon RDS provides new CA certificates as an Amazon security best practice. For information about the new certificates and the supported Amazon Regions, see Using SSL/TLS to encrypt a connection to a DB cluster.
Amazon RDS Proxy and Aurora Serverless use certificates from the Amazon Certificate Manager (ACM). If you are using RDS Proxy, when you rotate your SSL/TLS certificate, you don't need to update applications that use RDS Proxy connections. For more information about using TLS/SSL with RDS Proxy, see Using TLS/SSL with RDS Proxy.
If you are Aurora Serverless, rotating your SSL/TLS certificate isn't required. For more information about using TLS/SSL with Aurora Serverless, see Using TLS/SSL with Aurora Serverless v1.
If you are using a Go version 1.15 application with a DB instance that was created or updated to the rds-ca-2019
certificate prior to July 28, 2020, you must update the certificate again. Update the certificate to rds-ca-rsa2048-g1, rds-ca-rsa4096-g1,
or rds-ca-ecc384-g1 depending on your engine. Run the modify-db-instance
command shown
in the Amazon CLI section using the new CA certificate identifier. You can find the CAs that are available for a specific DB engine and DB engine
version using the describe-db-engine-versions
command.
If you created your DB instance or updated its certificate after
July 28, 2020, no action is required. For more information, see
Go GitHub issue #39568
Topics
Updating your CA certificate by modifying your DB instance
Complete the following steps to update your CA certificate.
To update your CA certificate by modifying your DB instance
-
Download the new SSL/TLS certificate as described in Using SSL/TLS to encrypt a connection to a DB cluster.
-
Update your applications to use the new SSL/TLS certificate.
The methods for updating applications for new SSL/TLS certificates depend on your specific applications. Work with your application developers to update the SSL/TLS certificates for your applications.
For information about checking for SSL/TLS connections and updating applications for each DB engine, see the following topics:
For a sample script that updates a trust store for a Linux operating system, see Sample script for importing certificates into your trust store.
Note The certificate bundle contains certificates for both the old and new CA, so you can upgrade your application safely and maintain connectivity during the transition period. If you are using the Amazon Database Migration Service to migrate a database to a DB cluster, we recommend using the certificate bundle to ensure connectivity during the migration.
-
Modify the DB instance to change the CA from rds-ca-2015 to rds-ca-2019.
Important By default, this operation restarts your DB instance. If you don't want to restart your DB instance during this operation, you can use the
modify-db-instance
CLI command and specify the--no-certificate-rotation-restart
option.This option will not rotate the certificate until the next time the database restarts, either for planned or unplanned maintenance. This option is only recommended if you don't use SSL/TLS.
If you are experiencing connectivity issues after certificate expiry, use the apply immediately option by specifying Apply immediately in the console or by specifying the
--apply-immediately
option using the Amazon CLI. By default, this operation is scheduled to run during your next maintenance window.
You can use the Amazon Web Services Management Console or the Amazon CLI to change the CA certificate from rds-ca-2015 to rds-ca-2019 for a DB instance.
To change the CA from rds-ca-2015 to rds-ca-2019 for a DB instance
Sign in to the Amazon Web Services Management Console and open the Amazon RDS console at https://console.amazonaws.cn/rds/
. -
In the navigation pane, choose Databases, and then choose the DB instance that you want to modify.
-
Choose Modify.
The Modify DB Instance page appears.
-
In the Connectivity section, choose rds-ca-2019.
-
Choose Continue and check the summary of modifications.
-
To apply the changes immediately, choose Apply immediately.
Important Choosing this option restarts your database immediately.
-
On the confirmation page, review your changes. If they are correct, choose Modify DB Instance to save your changes.
Important When you schedule this operation, make sure that you have updated your client-side trust store beforehand.
Or choose Back to edit your changes or Cancel to cancel your changes.
To use the Amazon CLI to change the CA from rds-ca-2015 to rds-ca-2019 for a DB instance,
call the
modify-db-instance command.
Specify the DB instance identifier and the --ca-certificate-identifier
option.
When you schedule this operation, make sure that you have updated your client-side trust store beforehand.
Example
The following code modifies mydbinstance
by setting the CA certificate to rds-ca-2019
.
The changes are applied during the next maintenance window
by using --no-apply-immediately
.
Use --apply-immediately
to apply the changes immediately.
By default, this operation reboots your DB instance. If you don't want to reboot your DB instance during
this operation, you can use the modify-db-instance
CLI command and specify the
--no-certificate-rotation-restart
option.
This option will not rotate the certificate until the next time the database restarts, either for planned or unplanned maintenance. This option is only recommended if you do not use SSL/TLS.
Use --apply-immediately
to apply the update immediately. By default, this operation is
scheduled to run during your next maintenance window.
For Linux, macOS, or Unix:
aws rds modify-db-instance \ --db-instance-identifier
mydbinstance
\ --ca-certificate-identifier rds-ca-2019 \--no-apply-immediately
For Windows:
aws rds modify-db-instance ^ --db-instance-identifier
mydbinstance
^ --ca-certificate-identifier rds-ca-2019 ^--no-apply-immediately
Updating your CA certificate by applying DB instance maintenance
Complete the following steps to update your CA certificate by applying DB instance maintenance.
To update your CA certificate by applying DB instance maintenance
-
Download the new SSL/TLS certificate as described in Using SSL/TLS to encrypt a connection to a DB cluster.
-
Update your database applications to use the new SSL/TLS certificate.
The methods for updating applications for new SSL/TLS certificates depend on your specific applications. Work with your application developers to update the SSL/TLS certificates for your applications.
For information about checking for SSL/TLS connections and updating applications for each DB engine, see the following topics:
For a sample script that updates a trust store for a Linux operating system, see Sample script for importing certificates into your trust store.
Note The certificate bundle contains certificates for both the old and new CA, so you can upgrade your application safely and maintain connectivity during the transition period.
-
Apply DB instance maintenance to change the CA from rds-ca-2015 to rds-ca-2019.
Important You can choose to apply the change immediately. By default, this operation is scheduled to run during your next maintenance window.
You can use the Amazon Web Services Management Console to apply DB instance maintenance to change the CA certificate from rds-ca-2015 to rds-ca-2019 for multiple DB instances.
Updating your CA certificate by applying maintenance to multiple DB instances
Use the Amazon Web Services Management Console to change the CA certificate for multiple DB instances.
To change the CA from rds-ca-2015 to rds-ca-2019 for multiple DB instances
Sign in to the Amazon Web Services Management Console and open the Amazon RDS console at https://console.amazonaws.cn/rds/
. -
In the navigation pane, choose Databases.
In the navigation pane, there is a Certificate update option that shows the total number of affected DB instances.
Choose Certificate update in the navigation pane.
The Update your Amazon RDS SSL/TLS certificates page appears.
Note This page only shows the DB instances for the current Amazon Region. If you have DB instances in more than one Amazon Region, check this page in each Amazon Region to see all DB instances with old SSL/TLS certificates.
-
Choose the DB instance you want to update.
You can schedule the certificate rotation for your next maintenance window by choosing Update at the next maintenance window. Apply the rotation immediately by choosing Update now.
Important When your CA certificate is rotated, the operation restarts your DB instance.
If you experience connectivity issues after certificate expiry, use the Update now option.
-
If you choose Update at the next maintenance window or Update now, you are prompted to confirm the CA certificate rotation.
Important Before scheduling the CA certificate rotation on your database, update any client applications that use SSL/TLS and the server certificate to connect. These updates are specific to your DB engine. To determine whether your applications use SSL/TLS and the server certificate to connect, see Step 2: Update Your Database Applications to Use the New SSL/TLS Certificate. After you have updated these client applications, you can confirm the CA certificate rotation.
To continue, choose the check box, and then choose Confirm.
-
Repeat steps 3 and 4 for each DB instance that you want to update.
Sample script for importing certificates into your trust store
The following are sample shell scripts that import the certificate bundle into a trust store.
Each sample shell script uses keytool, which is part of the Java Development Kit (JDK). For information about
installing the JDK, see
JDK Installation Guide
Topics
Sample script for importing certificates on Linux
The following is a sample shell script that imports the certificate bundle into a trust store on a Linux operating system.
mydir=tmp/certs if [ ! -e "${mydir}" ] then mkdir -p "${mydir}" fi truststore=${mydir}/rds-truststore.jks storepassword=changeit curl -sS "https://rds-truststore.s3.cn-north-1.amazonaws.com.cn/global/global-bundle.pem" > ${mydir}/global-bundle.pem awk 'split_after == 1 {n++;split_after=0} /-----END CERTIFICATE-----/ {split_after=1}{print > "rds-ca-" n ".pem"}' < ${mydir}/global-bundle.pem for CERT in rds-ca-*; do alias=$(openssl x509 -noout -text -in $CERT | perl -ne 'next unless /Subject:/; s/.*(CN=|CN = )//; print') echo "Importing $alias" keytool -import -file ${CERT} -alias "${alias}" -storepass ${storepassword} -keystore ${truststore} -noprompt rm $CERT done rm ${mydir}/global-bundle.pem echo "Trust store content is: " keytool -list -v -keystore "$truststore" -storepass ${storepassword} | grep Alias | cut -d " " -f3- | while read alias do expiry=`keytool -list -v -keystore "$truststore" -storepass ${storepassword} -alias "${alias}" | grep Valid | perl -ne 'if(/until: (.*?)\n/) { print "$1\n"; }'` echo " Certificate ${alias} expires in '$expiry'" done
Sample script for importing certificates on macOS
The following is a sample shell script that imports the certificate bundle into a trust store on macOS.
mydir=tmp/certs if [ ! -e "${mydir}" ] then mkdir -p "${mydir}" fi truststore=${mydir}/rds-truststore.jks storepassword=changeit curl -sS "https://rds-truststore.s3.cn-north-1.amazonaws.com.cn/global/global-bundle.pem" > ${mydir}/global-bundle.pem split -p "-----BEGIN CERTIFICATE-----" ${mydir}/global-bundle.pem rds-ca- for CERT in rds-ca-*; do alias=$(openssl x509 -noout -text -in $CERT | perl -ne 'next unless /Subject:/; s/.*(CN=|CN = )//; print') echo "Importing $alias" keytool -import -file ${CERT} -alias "${alias}" -storepass ${storepassword} -keystore ${truststore} -noprompt rm $CERT done rm ${mydir}/global-bundle.pem echo "Trust store content is: " keytool -list -v -keystore "$truststore" -storepass ${storepassword} | grep Alias | cut -d " " -f3- | while read alias do expiry=`keytool -list -v -keystore "$truststore" -storepass ${storepassword} -alias "${alias}" | grep Valid | perl -ne 'if(/until: (.*?)\n/) { print "$1\n"; }'` echo " Certificate ${alias} expires in '$expiry'" done