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

Method MinioClientFactory.CreatClient always creates a client with SSL true, even if you configure it as false; #884

Closed
voryba opened this issue Oct 11, 2023 · 5 comments
Assignees

Comments

@voryba
Copy link

voryba commented Oct 11, 2023

Method MinioClientFactory.CreatClient always creates a client with SSL true, even if you configure it as false;

Expected Behavior

public static IMinioClient WithSSL(this IMinioClient minioClient, bool secure = true)
{
    if (minioClient is null) throw new ArgumentNullException(nameof(minioClient));

    if (secure)
    {
        minioClient.Config.Secure = true;
        if (string.IsNullOrEmpty(minioClient.Config.BaseUrl))
            return minioClient;
        //var secureUrl = RequestUtil.MakeTargetURL(minioClient.BaseUrl, minioClient.Secure);
    }
    else
    {
        minioClient.Config.Secure = false;
     }
    return minioClient;
}

Current Behavior

    var client = new MinioClient()
        .WithSSL(); --> defaut value is true

// after this client will be configured with action:
configureClient(client);

// In the method there is no action for the false case. So when you created client before, its already created with SSL true

public static IMinioClient WithSSL(this IMinioClient minioClient, bool secure = true)
{
    if (minioClient is null) throw new ArgumentNullException(nameof(minioClient));

    if (secure)
    {
        minioClient.Config.Secure = true;
        if (string.IsNullOrEmpty(minioClient.Config.BaseUrl))
            return minioClient;
        //var secureUrl = RequestUtil.MakeTargetURL(minioClient.BaseUrl, minioClient.Secure);
    }
    -- NO ACTION FOR FALSE CASE;
    return minioClient;
}
@jiuker jiuker transferred this issue from minio/minio Oct 11, 2023
@balamurugana
Copy link
Member

We do not ship MinioClientFactory. You would need to open/report this issue to respective project.

@harshavardhana harshavardhana transferred this issue from minio/minio-java Oct 11, 2023
@ebozduman
Copy link
Collaborator

Looking into it...

@ebozduman
Copy link
Collaborator

This issue is fixed in the upcoming PR #844.
It is currently in code review and it'll be merged as soon as the code review is complete and approved.

@ebozduman
Copy link
Collaborator

ebozduman commented Oct 21, 2023

@voryba, @fabientrissie, @S3V3N-11

PR #844 is merged.

Could you please test it and close this issue if it passes your test?

@ebozduman ebozduman added fixed and removed triage labels Oct 21, 2023
@ebozduman
Copy link
Collaborator

Closing as fixed.
Please reopen if you disagree.

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

No branches or pull requests

4 participants