-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception thrown when using IAM authentication in CN RDS #579
Comments
Hi @fantasy194 , Thanks for reaching out and raising this issue. We'll take a look at this and keep you updated as we investigate. Thank you for your patience! |
Hi @fantasy194 While this fix is in progress, I wanted to bring to your attention that the maintenance window for the AWS MySQL JDBC Driver will be ending very soon on July 25 2024 as per the maintenance policy linked here. I would highly recommend that before the AWS MySQL JDBC Driver maintenance window ends, adopting the Thank you |
Thank you for the fix and reminder ❤ |
Hi @fantasy194 We have just merged in a fix. Could you kindly checkout our snapshot build and let us know if the issue still persists? Thank you! |
I have tried aws-mysql-jdbc-1.1.15-20240530.215033-2 version and it's works now! Thank you again |
Hi @fantasy194 The fix is now available on the latest version of the AWS MySQL JDBC Driver. Please let us know if you have any issues with it. Thank you! |
Describe the bug
An exception was thrown when I enabled IAM authentication on the URL parameter of CN RDS:
Mon May 20 09:31:55 UTC 2024 TRACE: Unsupported AWS hostname 'xxxxx.cluster-xxxxxxxxxx.rds.cn-northwest-1.amazonaws.com.cn'. Amazon domain name in format *.AWS-Region.rds.amazonaws.com is expected
My config is:
spring.datasource.url=jdbc:mysql:aws://xxxxx.cluster-xxxxxxxxxx.rds.cn-northwest-1.amazonaws.com.cn:3306/xxxxxxxx?useUnicode=true&characterEncoding=UTF-8&useSSL=true&useAwsIam=true
I have tried to set 'clusterInstanceHostPattern' but is not working.
Expected Behavior
Works normally
Current Behavior
An exception thrown block the application initialization
Reproduction Steps
Set a CN RDS URL like '?.rds.AWS-CNRegion.amazonaws.com.cn' and enable IAM authentication
Possible Solution
com.mysql.cj.protocol.a.authentication.AwsIamAuthenticationTokenHelper.getRdsRegion() use a fixed regular expression
![image](https://private-user-images.githubusercontent.com/22437438/332261128-9189a8d1-fc6b-4df4-9318-75eaae6fb670.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyMDU0NjksIm5iZiI6MTczOTIwNTE2OSwicGF0aCI6Ii8yMjQzNzQzOC8zMzIyNjExMjgtOTE4OWE4ZDEtZmM2Yi00ZGY0LTkzMTgtNzVlYWFlNmZiNjcwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDE2MzI0OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNkOWY1ZWMxMmE5MjE0MGUzOTEyYzU2ZmJiYjI0ZmM0NDcwM2ExNTU1MDdkZDY2ODk3YWU4YTE1ZGU1YTdhOWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.mRtjxWfwwjxY37Nh8NlxfjNsoni484h-ZT47KB_oJIA)
Additional Information/Context
No response
The AWS JDBC Driver for MySQL version used
1.1.14
JDK version used
graalvm ce 11
Operating System and version
Windows11
The text was updated successfully, but these errors were encountered: