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

fix custom s3 host handling LDEV-3594 #12

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open

Conversation

zspitzer
Copy link
Member

@zspitzer zspitzer commented Jul 19, 2021

@zspitzer
Copy link
Member Author

zspitzer commented Jul 21, 2021

this works great with https://min.io/download

-- run the server
minio server c:\work\db\minio\data --console-address ":9001"

-- monitor the s3 activity
mc alias set minio http://localhost:9000 minioadmin minioadmin
mc admin trace minio --verbose

ant -DtestLabels="s3" -DtestExtensions="C:\work\lucee-extensions\extension-s3\dist" -DtestDebug="true"

with this in the env

"S3_CUSTOM_ACCESS_KEY_ID": "minioadmin",
"S3_CUSTOM_SECRET_KEY": "minioadmin",
"S3_CUSTOM_HOST": "http://localhost:9000",

image

but it's crashing, whilst checking to see if something exists after it's create?

 [java]    [script] Failed: test.general.Resources
 [java]    [script] 	testS3custom
 [java]    [script] 	Expected [false] to be true
 [java]    [script] 		/home/runner/work/extension-s3/extension-s3/lucee/test/general/Resources.cfc:196
 [java]    [script] 		/home/runner/work/extension-s3/extension-s3/lucee/test/general/Resources.cfc:34
 [java]    [script] 		/home/runner/work/extension-s3/extension-s3/lucee/test/general/Resources.cfc:153

https://github.com/lucee/Lucee/blob/6.0/test/general/Resources.cfc#L196

@zspitzer zspitzer changed the title fix custom host logic check LDEV-3594 fix custom s3 host handling LDEV-3594 Jul 21, 2021
@zspitzer
Copy link
Member Author

zspitzer commented Aug 5, 2021

all the tests now pass for s3 or s3_custom (local min.io)

however, if both service profiles are enabled, it ends up throwing

Request Error: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target;could not create the bucket [lucee-res-994587a9f8e1d273d5a174a1342f37b3], please consult the following website to learn about Bucket Restrictions and limitations: https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html [java] [script] C:\work\lucee6\test\general\Resources.cfc:28

@zspitzer
Copy link
Member Author

zspitzer commented Aug 5, 2021

the PKIX error is due to a mixing up of properties, which ends up with a url of https://localhost:443 which is obviously wrong

digging into the jets3t innards with a debugger, I can see the correct properties being set in this.jetS3tProperties in RestStorageService.java

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant