Xamarin forms android - disables SSL CA validation

Hello we are facing a security problem with apk, there's a application validating our apk (Appthority) and reports this:

Disables SSL CA Validation

[
{
"status": "DISABLED",
"hostname": "xxx.xxxxxx-xx.com",
"connection": "10.27.68.128:40326->192.129.240.16:443",
"validation_hostnames": [
]

wa are using https connection for WS and SSL/TLS implementation, and trusted certificate

this only happens with apk but not with ipa

greetings

Answers

  • jezhjezh Member, Xamarin Team Xamurai

    Could you please share the https request code ?

  • jorge_cisnerosjorge_cisneros Member ✭✭

    Request code:

    public const string Backend = "https://xxx.xxxxxx-xx.com/xxxxxxx/xxxxxxApi/api/";

    //GET
    public async static Task Get(T type, string requestURL)
    {
    string serviceUri = Backend + requestURL;
    var data = "";
    try {
    using (var httpClient = new HttpClient()) {
    data = await httpClient.GetStringAsync(serviceUri);
    }
    var json1 = JsonConvert.DeserializeObject(data);
    type = json1;
    }catch (Exception error)
    {
    Console.WriteLine(error);
    }
    return type;
    }
    //POST
    public async static Task Post(T modelo, string requestURL) {

            HttpResponseMessage response = null;
            try {
                using (var httpClient = new HttpClient()) {
    
                    string serviceUri = Backend + requestURL;                   
                    var output = JsonConvert.SerializeObject(modelo);
                    var content = new StringContent(output, Encoding.UTF8, "application/json");                    
                    response = await httpClient.PostAsync(serviceUri, content);                    
                }
            }
            catch (Exception error) {
                Console.WriteLine(error);
            }
    
            return response;
        }
    

    Thanks in advance

Sign In or Register to comment.