TLS is not yet fully implemented in Mono. This means that your HTTPS requests may fail if they do not work when running your .NET application on Windows.
Xamarin Deployment
Since you are using Xamarin, you can use ModernHttpClient , which is a wrapper around the native iOS / Android network libraries.
Android, Mac, and iOS users can get the latest TLS for HTTP workloads using ModernHttpClient. Mac / iOS users can use the built-in CFNetworkHandler.
Linux / Mac Deployment
If you are installing Mono on Linux / Mac (without Xamarin), you need to find a workaround due to the lack of TLS support.
There are two possible workarounds:
Use custom TLS implementation
Try juhovh / AaltoTLS , which is an implementation of the SSL / TLS network protocol, written entirely using C # and the standard .NET cryptographic libraries. where appropriate. It will take care of decrypting / encrypting TLS and will not use the built-in devoid Mono implementation.
TLS Proxy Implementation
Create a TLS proxy that will perform TLS for you - you will configure it as an HTTP proxy for your HTTP requests in Mono, it will receive them and request the target server via HTTPS, encryption and decryption processing for the Mono application.
Workflow:
Mono App → HttpClient sends an HTTP request via TLS Proxy → TLS Proxy converts the HTTP request to HTTPS and sends it to the target server → TLS proxy receives a response → TLS proxy sends a response to HttpClient in HTTP format
Sample code in Node.js for the TLS Proxy workaround using nodejitsu / node-http-proxy :
// Modules var http = require('http'); var httpProxy = require('http-proxy'); // Proxy server options var options = {secure: true}; // Validate remote SSL certificates // Create a proxy server with custom application logic var proxy = httpProxy.createProxyServer(options); // Handle errors gracefully proxy.on('error', function(e) { // Log to console console.log(e); }); // Create server and define custom logic var server = http.createServer(function(req, res) { // URL provided? if (req.url) { // Convert to HTTPS req.url = req.url.replace('http://', 'https://'); } // Get remote host from headers (and force HTTPS) var target = 'https://' + req.headers.host; // Proxy the request (target is the server to pass the request on to) proxy.web(req, res, { target: target }); }); // Proxy port var port = 8080; // Start listening for requests from clients server.listen(port); // Log the port number console.log('proxy.port: ' + port);