sydseter / aws-s3-mtls-nginx-minio

This repository demonstrate the use of mTLS when uploading and downloading files from Minio S3 using the AWS SDK
0 stars 0 forks source link

verify mTLS #11

Open ptthuc26 opened 1 year ago

ptthuc26 commented 1 year ago

image

Hi Mr.sydseter, when i verify mTLS nginx, it require me enter pass phasae. please help me enter code. i dont know the code.

thank you

ptthuc26 commented 1 year ago

@sydseter please help me this issue. thank you

ptthuc26 commented 1 year ago

image when run test, the errors in picture. please help me

sydseter commented 1 year ago

This is not an issue. It's a negative test. It test that minio returns 405, but it seems like they return 400 in stead. This might have been an api change to the minio s3 spec.

ptthuc26 commented 1 year ago

So what I can do now to pass the tests? @sydseter

sydseter commented 1 year ago

change this from 405 to 400. https://github.com/sydseter/aws-s3-mtls-nginx-minio/blob/master/src/test/java/no/sydseter/MinioTest.java#L189

The test should be disabled probably.

ptthuc26 commented 1 year ago

Thank you. What about the other 2 tests? testputFileFromBucket and testGetFileFromBucket @sydseter

sydseter commented 1 year ago

I am not sure. I would have to have a look.

ptthuc26 commented 1 year ago

Can you guide detail me on how to install this? The guide is not detail so i don't know how to run. thank you

sydseter commented 1 year ago

The procedure for installing is described on the README. https://github.com/sydseter/aws-s3-mtls-nginx-minio#installation If you click on the links you get a more detailed guide for installing each of the dependencies.

ptthuc26 commented 1 year ago

Can you explain the tests? I don't understand what the tests do. and you can run again project to debug error for me?. thank you very much

sydseter commented 1 year ago

The tests does the following:

MinioSSECTest.testputFileFromBucket: Uploading a new object to S3 from a file using SSE Customer Key (withSSECustomerKey)

MinioSSECTest.testMtlsConnection : Check https connection to Minio

MinioTest.testputFileFromBucket: Uploading a new object to S3 from a file without SSE Customer Key MinioTest.testMtlsConnection : Checks https connection to Minio

The tests requires Minio and NginX to be installed

I do not have the time today to look at this. It's been some years since I looked at this myself.

ptthuc26 commented 1 year ago

image hi @sydseter , i try enter "client" when enter passphrase pem, but it not work. please help me

sydseter commented 1 year ago

you forgot --cert certs/client.pem

ptthuc26 commented 1 year ago

sorry i capture not full, but i had. i using "curl --verbose -X POST -d '{"someparam1":"somevalue1","someparam2":"somevalue2"}' -H "Content-Type: application/json" -k https://localhost:8092 --cert certs/client.pem --key certs/client.key"

ptthuc26 commented 1 year ago

image when i using certs/client_nopassword.key. it like picture. why is 400 bad request?

sydseter commented 1 year ago

Hi, this is a concept repository for using a reverse proxy in front of a s3 compatible server and I am afraid I haven't been able to keep this example up to date. This was done in order to demo certificate based authentication at a time when that option was not available through s3. I believe this has changed now with the use of "Certificate-based Authentication for S3": https://blog.min.io/certificate-based-authentication-with-s3/

I therefor do not recommend venture down the road of implementing a proxy in front since Certificate-based Authentication through s3 is a much better solution.

If you need help with minio, then I would contact the team that is responsible for doing the minio development. https://github.com/minio/minio

I am sorry I don't have time to help you any further, but I just do not have the time to debug this 4 years after i wrote it.