Skip to content
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

Closed
fantasy194 opened this issue May 21, 2024 · 6 comments
Closed

Exception thrown when using IAM authentication in CN RDS #579

fantasy194 opened this issue May 21, 2024 · 6 comments
Assignees
Labels
bug Something isn't working pending release Resolution implemented, pending official release

Comments

@fantasy194
Copy link

fantasy194 commented May 21, 2024

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

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

@fantasy194 fantasy194 added the bug Something isn't working label May 21, 2024
@hsuamz hsuamz assigned hsuamz and aaronchung-bitquill and unassigned hsuamz May 21, 2024
@aaronchung-bitquill
Copy link
Contributor

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!

@aaronchung-bitquill
Copy link
Contributor

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 aws-advanced-jdbc-wrapper. It offers many of the same features and more. And most importantly, will still be covered by its maintenance window.

Thank you

@fantasy194
Copy link
Author

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 aws-advanced-jdbc-wrapper. It offers many of the same features and more. And most importantly, will still be covered by its maintenance window.

Thank you

Thank you for the fix and reminder ❤

@aaronchung-bitquill
Copy link
Contributor

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!

@fantasy194
Copy link
Author

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

@aaronchung-bitquill aaronchung-bitquill added the pending release Resolution implemented, pending official release label May 31, 2024
@aaronchung-bitquill
Copy link
Contributor

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending release Resolution implemented, pending official release
Projects
None yet
Development

No branches or pull requests

3 participants