Skip to content

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

@voryba

Description

@voryba

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;
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions