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; #883

Closed
voryba opened this issue Oct 11, 2023 · 1 comment

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;
}
@ebozduman
Copy link
Collaborator

Duplicate of #884

@ebozduman ebozduman marked this as a duplicate of #884 Oct 12, 2023
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

No branches or pull requests

2 participants