Q:

Visual Studio WCF Connected Service certificate verification

I need to use a WCF service.  I'm working with ASP.NET 5 so a have to use the extension Visual Studio WCF Connected Service.  When I try to add the WCF service reference to my Class Library I can't do it because the verification of certificates .  I have the certificate installed in my computer but doesn't seems to work. 
How can I ignore the verification of the certificate when is adding the service in my project? 
Using the full .NET Framework this can be done by adding   

ServicePointManager. ServerCertificateValidationCallback +=
(sender, cert, chain, sslPolicyErrors) => true;
var service = new DataServiceSoapClient("DataServiceSoap");

but this is after adding the service reference to the project and my problem is when adding the service. 
The full description of the error is:
Scaffolding Code ...
Attempting to download metadata from  'https://login.uh.cu/webservices/dataservice.asmx' using WS-Metadata Exchange and HttpGet. 

Error:Error: Cannot obtain Metadata from     https://login.uh.cu/webservices/dataservice.asmx 
If this is a Windows (R) Communication Foundation service to which you have      access, please check that you have enabled metadata publishing at the specified     address.   For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455. 
WS-Metadata Exchange Error
URI: https://login.uh.cu/webservices/dataservice.asmx
Metadata contains a reference that cannot be resolved: 'https://login.uh.cu/webservices/dataservice.asmx/mex'. 
Could not establish trust relationship for the SSL/TLS secure channel with authority 'login.uh.cu'.  
The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.     
The remote certificate is invalid according to the validation procedure.     

Failed to generate service reference. 

A:

In general it's really no good practice to host a SSL-"secured" service using an invalid certificate... Anyways I've worked with customers recently that expose all their services using self-signed certificates, too.  
As you already noticed you need a way to "accept" the untrusted source right before setting the ServerCertificateValidationCallback as that callback is used later on in your user-code when executing your ASP.NET site.  When adding the service reference this callback isn't yet used.  But keep in mind that it's dangerous to generally validate any certificate which you do with the code above.  You shouldn't use that in production!  
When trying to add the service reference via the resp.  Visual Studio dialog it refuses to do so as VS can't validate the remote certificate.  Exactly the issue you encountered.  
One way to work around this is to invoke the WSDL via your browser.  Your browser usually allows you to skip SSL warnings.  Doing so you can save the WSDL manually to a local file and use that file to let VS add the service reference. 

To show you an example I've illustrated this approach by using the Global Weather Service (which isn't SSL-secured at all, but can serve as an example anyway). 
Its asmx-service is located at http://www.webservicex.net/globalweather.asmx.  By adding ? wsdl you can usually retrieve the WSDL directly: http://www.webservicex.net/globalweather.asmx?wsdl
You can do the same with your service: https://login.uh.cu/webservices/dataservice.asmx?wsdl
Your browser should then prompt an SSL-warning which you should be able to skip.  The way of skipping the warning depends on the browser you're using.  Maybe have a look at this. 
After you skipped the warning you should see the WSDL directly in your browser.  As an example I have done so using google chrome:

You can then right-click the result and save it anywhere on your local disk. 
Back in Visual Studio you can add the service via the add reference dialog by pointing to the locally saved WSDL-file:

