Build Failing due to nuget not being able to connect to remote server

My jenkins server has proxy configured at hostname:80. I am trying to build a C# project using msbuild plugin and nuget. When I trigger a build, it fails with the below message.

https://api.nuget.org/v3/index.json: Unable to load the service index for source https://api.nuget.org/v3/index.json. An error occurred while sending the request.

My Nuget configuration is as below:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
    <add key="http_proxy" value="https://myhostname:80" />
   </config>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
  </packageSources>
</configuration>

Can someone please suggest a solution?