Our webapp with FedEx Rate Request API stopped working recently.
Now I have downloaded the newest FedEx Rate API C# sample project from here:
https://www.fedex.com/us/developer/downloads/sample/2021/standard/RateService_v31_cs.zip
It shows the the same error:
"The request was aborted: could not create ssl/tls secure channel."
Can someone help, what the problem/solution can be?
Thanks in advance!
p.s.
This is the page where from I have downloaded the example project:
https://www.fedex.com/en-us/developer/web-services/process.html#StandardServices
The solution by #MarkPM:
"It's probably because they updated to use Tls1.2, try using it in your app: System.Net.ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls12"
Related
I am trying to integrate Adyen in a .net application.
Downloaded the sample code from their Github repository and hardcoded the api-key, merchant and client keys in the code to make sure they are getting populated.
Running the code from my localhost
I am getting this error
{"status":401,"errorCode":"000","message":"HTTP Status Response - Unauthorized","errorType":"security"}
at this line:
var res = _checkout.Sessions(sessionsRequest);
Sample code is here
https://github.com/adyen-examples/adyen-dotnet-online-payments
Any idea of what I am missing?, anyone faced the same issue?
Thanks!
Thank you, i was able to get successful calls after checking how those keys are set to the environment variables. Also Client key is important.
Sometimes my client is getting an error during the payment process:
The request was aborted: Could not create SSL/TLS secure channel.
Authorize.NET has been used for the payment system. .Net 4.0 Framework is being used. This error is occurring sometimes, why?
Please try this suggested answer on github to https://github.com/AuthorizeNet/sdk-dotnet/issues/203:
using System.Security.Authentication;
using System.Net
// Prior to your web request ...
const SslProtocols _Tls12 = (SslProtocols)0x00000C00;
const SecurityProtocolType Tls12 = (SecurityProtocolType)_Tls12;
ServicePointManager.SecurityProtocol = Tls12;
(Comment by NexWeb.)
This is happening due to invalid version of .NET Braintree SDK.
You need to update the .NET Braintree SDK you're using to at least version 3.1.0, the minimum version that supports TLS 1.2. Once complete, you can validate your setup using the steps here.
Also, you need to update the .net version from 4.0 to 4.5
For more information, check this link.
I am trying to call a Web API using HttpWebRequest(Console Application).
To upload the file, I am using the code snippet provided by #Cristian Romanescu ont this question Upload files with HTTPWebrequest (multipart/form-data)
If I set the req.ProtocolVersion as HttpVersion.Version10,I get Bad request when I try to do req.GetResponseStream().
If i set the req.ProtocolVersion as HttpVersion.Version11,I get Could not create SSL/TLS secure channel. when i try to do req.GetResponseStream().
If tried to post the data using POSTMAN, but even Postman says Could not get any response".
If I try to hit the URL using IE-11 I get HTTP 404.[I know i am not posting the actual file], but Chrome displays the custom/appropriate error message.
I tried the solutions already provided on stackoverflow, but unfortunately they do not solve my problem.
Thankyou.
Which solution you have tried? It's worth trying the following if you haven't already - write following before you actually invoke the service:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
Two things that I was doing wrong.
The Server wanted date in yyyy-MM-ddTHH:mm:ss, I was providing the date in yyyy-MM-ddTHH:mm:ss.ssss Format(DateTime.UtcNow.ToString("o")). This was the cause of Could not create SSL/TLS secure channel
The server wanted the parameters in request body as well. I had passed the parameters only as query string. This was the cause of HTTP 404
In the process, I had asked a guy outside my team to help. He had asked me to see if there were any SSL related errors. To do this he asked me to add
System.Net.ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(AcceptAllCertifications); and define AcceptAllCertifications, which was not the case. So to resolve the issue, I had to take care of the things mentioned above.
Try to create self signed certificate from your server and add it to your client machine.
Create self signed certificate (Server side)
Import self signed certificate (Client side)
I am making use of the EWS managed API and it used to work perfectly until one fine day the autodiscover url changed (Is it possible?).
The code is pretty straight forward:
service.Credentials = new NetworkCredential("email#contoso.com", userData.Password);
service.AutodiscoverUrl("email#contoso.com", RedirectionUrlValidationCallback);
The url which I am getting is as follows: https://contoso.com/EWS.Exchange.asmx (note the EWS.Exchange).
I have enabled the tracing and that url is also in the traces but I got stuck.
Anyone has any ideas to why this is happening? I tried to search but found nothing.
Oh yes, the exchange which I am using is exchange 2007.
Thanks!
My guess is there is a misconfiguration somewhere. You might start by checking your EWS settings on the Client Access Server: Get-WebServicesVirtualDirectory -Identity EWS(default web site)
So, what I did was start from the beginning.
I removed my current certificates and created new ones... and it worked!
I do not understand why but hopefully it will help others as well :).
I followed this tutorial: http://www.howtogeek.com/107415/it-how-to-create-a-self-signed-security-ssl-certificate-and-deploy-it-to-client-machines/
I was hoping one of you could help me with the use of AWS Kinesis. I have been pouring over the documentation and I am still unable to post a "blob" of data to a Kinesis stream.
In the API the standard POST request is as follows.
POST / HTTP/1.1
Host: kinesis.<region>.<domain>
x-amz-Date: <Date>
Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=contenttype;
date;host;user-agent;x-amz-date;x-amz-target;x-amzn-requestid, Signature=<Signature>
User-Agent: <UserAgentString>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Kinesis_20131202.PutRecord
{
"StreamName": "exampleStreamName",
"Data": "XzxkYXRhPl8x",
"PartitionKey": "partitionKey"
}
Using "Postman" a google chrome app to make Http requests and filling in the appropriate information for the above fields I cannot for the life of me figure out how to make a successful data post to a stream. I was unable to do this successfully so i went on to do use the .NET SDK for visual studio.
I made a quick command line c# console application I am still having some issues.
My code:
http://pastebin.com/cyJeC0vU
The error message, System.Xml.XmlException was unhandled, appears on line 61 of the code: http://pastebin.com/HEG7DmMw
Has anyone had a successful experience using AWS Kinesis. I would love to pick your brain / repay you somehow for a bit of tutoring.
Thanks again for all of your help!
The error you're getting indicates that the response from the service was not able to be parsed. There is a clue in that the SDK switched from the JSON parser to the XML parser because the response looked like XML. This usually indicates that you are behind a proxy which requires authentication, and the proxy is giving you an HTML error message.
You can verify this by firing up a protocol analyzer like Fiddler and watching the request traffic. If your proxy requires credentials, here is some documentation about using the AWS SDK for .NET with proxies:
Configuring Credentials for Your AWS SDK for .NET Application