PayPal TLS 1.2 upgrade issues - paypal

With the PayPal TLS 1.2 upgrade looming, I'm in a rush to upgrade my clients payment system. The problem is, they are on .NET 3.5. I've talked to PayPal support and they said that their SDK only supports .NET 4.5. To upgrade the entire site to 4.5 will take an EXTREMELY long time to complete. So unless they are wrong and someone can point me in the right direction on how to implement the payflow pro SDK into a .NET 3.5 system, I have come up with 2 options (aside from an upgrade):
Use WebClient to connect to the payflow gateway. I like this solution but I'm not getting a response. I have two snippets of code
using (System.Net.WebClient wc = new System.Net.WebClient())
{
wc.Headers.Add("Content-type", "text/namevalue");
wc.Headers.Add("Content-Length", requestData.ToString().Length.ToString());
wc.Headers.Add("X-VPS-Timeout", "30");
wc.Headers.Add("X-VPS-Request-ID", System.Guid.NewGuid().ToString());
wc.Headers.Add("X-VPS-VIT-Client-Type", "PHP/cURL");
string HtmlResult = wc.UploadString("https://" + this.HostAddress, requestData.ToString());
}
and
System.Net.HttpWebRequest httpWebRequest = (System.Net.HttpWebRequest)System.Net.WebRequest.Create("https://" + this.HostAddress);
httpWebRequest.ContentType = "text/namevalue";
httpWebRequest.ContentLength = rawRequestData.Length;
httpWebRequest.Headers.Add("X-VPS-Timeout", "30");
httpWebRequest.Headers.Add("X-VPS-Request-ID", System.Guid.NewGuid().ToString());
httpWebRequest.Headers.Add("X-VPS-VIT-Client-Type", "PHP/cURL");
httpWebRequest.Method = "POST";
using (var stream = httpWebRequest.GetRequestStream())
{
stream.Write(rawRequestData, 0, rawRequestData.Length);
}
var response = (System.Net.HttpWebResponse)httpWebRequest.GetResponse();
var stringResponse = new System.IO.StreamReader(response.GetResponseStream()).ReadToEnd();
both are returning empty response exceptions.
The alternative is to create a local webservice that's compiled in .NET 4.5 and have the web app consume it to process transactions. This will all be done locally, so it's not like the web app is communicating with another computer, it will be connecting to a webservice that is local. As for the webservice, I'll make it respond only to local requests. The problem is that there won't be an SSL on the web service. So the big question is, if the webservice doesn't respond to external requests, requests are made internally, will it break PCI compliance?

I have not had to resort to this because the apps I maintain are 4.5 or higher but
"The .NET framework version 3.5.1 and earlier versions did not provide support for applications to use Transport Layer Security (TLS) System Default Versions as a cryptographic protocol. This update enables the use of TLS v1.2 in the .NET Framework 3.5.1."
https://support.microsoft.com/en-us/help/3154518/support-for-tls-system-default-versions-included-in-the-.net-framework-3.5.1-on-windows-7-sp1-and-server-2008-r2-sp1

Related

Couchbase 4.1 - N1QL by endpoint

I use Reactive Couchbase (this is Scala port for Java SDK - https://github.com/ReactiveCouchbase/ReactiveCouchbase-core)
And for query this use http endpoint (http:// mycouchbaseadress:8093 /query?q=N1QL Comand) but response for server is "Unrecognized parameter in request: q".
I Find in stackoverflow to start cbq-engine so try to launch 'cbq-engine -couchbase http:// mycouchbaseadress:8093 /' but have error ''flag provided but not defined: -couchbase"
My couchbase version is 4.1 community
Do you know how I can send my n1ql query to server by endpoint?
It seems like there is a bug in ReactiveCouchbase, or at least its N1QL support was developed against an outdated beta version of the feature.
With Couchbase Server 4.0 GA and above, you don't need to run cbq-engine (this was the process used during N1QL's beta).
The problem is that in the code, the q= parameter is used where it should now be statement= (or a JSON body).
There is a open pull-request that happens to fix that issue among other things, but it's been opened a long time.

Side-loaded Windows 8.1 application generates an exception when calling methods of an RESTful Web API

I have developed a Line-of-Business (LOB) Windows 8.1 application for one of our clients. The app was developed in Visual Studio 2015, on my 64-bit Windows 8.1 Enterprise laptop. The application makes use of a RESTful Web API that is running under IIS Express on the same laptop. The IIS Express has been configured to expose the RESTful Web API to the outside world, such that I can make Web API calls with Fiddler from a different machine. My app works just fine when I test it with the VS2015 Simulator, even when I configure it to use the correct IP address of the Web API (not the localhost).
The client wants to deploy this app in production on some DELL tablets that will run Windows 10. I have one of these tablets and it has 64-bit Windows 10 Enterprise on it. When I side-load my app on the tablet, I launch it and I save in its settings the URL for the Web API service. I relaunch the app, but the first call into the Web API fails to complete. I log an exception informing me that "An error occurred while sending the request". The inner exception message is "Unable to connect to the remote server". The line of code that triggers this exception is this one:
HttpResponseMessage response = await WebApiHttpClient.GetAsync("api/user", HttpCompletionOption.ResponseContentRead).ConfigureAwait(continueOnCapturedContext: false);
where the WebApiHttpClient object is a class static member constructed like this:
if (WebApiHttpClient == null)
{
WebApiHttpClient = new HttpClient(WebApiAuthClientHandler)
{
BaseAddress = new Uri(_serviceUri), // _serviceUri is a string that looks like this "http://10.120.5.201:53045"
Timeout = new TimeSpan(0, 0, 150)
};
WebApiHttpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
}
The WebApiAuthClientHandler is also a class static member that is instantiated like this:
if (WebApiAuthClientHandler == null)
{
WebApiAuthClientHandler = new HttpClientHandler()
{
Credentials = CredentialCache.DefaultNetworkCredentials,
ClientCertificateOptions = ClientCertificateOption.Automatic
};
}
The exception is triggered about 21 seconds after my call so it can't be a timeout since the timeout is set to 150 seconds.
The Web API is running on my laptop, as I mentioned before and using the node.js iisexpress-proxy tool I managed to expose the local URL to the outside world so that I can make Web API calls using Fiddler running on the tablet.
Also, in my app's Package.appxmanifest/Capabilities I have checked the "Private Networks (Client & Server)".
The Event Viewer does not log any additional information.
Can anyone make a suggestion on why the error is triggered?
TIA,
Eddie
The error message I have in my 3rd comment was caused by the fact that I had Fiddler running at the same time. When running without Fiddler, the application receives a different error, but that will be the subject of a different question here, on StackOverflow.

wso2 api manager 1.6.0 publisher - published api call to addAPI silently fails

WSO2 API Manager 1.6.0 introduced a new problem, a REST Post to addAPI returns success but the added API record is incomplete, thus unusable. Inspecting the log file, I traced the issue to /publisher/site/themes/default/templates/overview/template.jag#3, a change in the jaggery file template.jag causes a java null pointer exception on line 3 with the following code 'var endpoint_config = parse(api.endpointConfig);'
With API Manager 1.5.0 this same REST API call worked but it took 3 min to complete on a VMWare box running SLES 11 SP2. Adding an API via the web interface also took 3 min. Trying both on Mac OS X and Windows, it took about 3 secs to run. With API Manager 1.6.0 on the same environments, the web interface now runs under 6 secs and the added API is correct. Now adding an API via the REST call results in an incomplete record being created, tested on both VMWare with SLES 11 SP2 and Mac OSX Mavericks.
Anyone experienced this issue?
It seems documents related to publisher APIs have not been updated yet. With API Manager 1.6.0 there has been a change in the way endpoints are stored. To make the REST API call working can you try with a request similar to following;
curl -X POST -b cookies http://localhost:9763/publisher/site/blocks/item-add/ajax/add.jag -d"action=addAPI&name=YouTube1&context=%2Fyoutube1&version=1.0.0&tier=Gold&responseCache=disabled&visibility=public&endpoint_config=%7B%22production_endpoints%22%3A%7B%22url%22%3A%22http%3A%2F%2Fgdata.youtube.com%2Ffeeds%2Fapi%2Fstandardfeeds%2Fmost_popular%22%2C%22config%22%3Anull%7D%2C%22endpoint_type%22%3A%22http%22%7D&endpointType=nonsecured&subscriptions=current_tenant&resourceTemplate=%2F*&resourceCount=0&resourceMethod-0=POST&resourceMethodAuthType-0=Application&uriTemplate-0=%2F*&resourceMethodThrottlingTier-0=Unlimited&tiersCollection=Gold"
When decoding the request you can see that endpoint is now defined as a JSON
endpoint_config={"production_endpoints":{"url":"http://gdata.youtube.com/feeds/api/standardfeeds/most_popular","config":null},"endpoint_type":"http"}

Can ASP.NET Web API methods be called from a Windows CE app / CF 3.5?

We were thinking about doing something like WCF / REST - I think the techn[ique,ology] was called ADO.NET Data Services in VS 2008 / .NET 3.5 - anyway, something like a RESTful receiving and transmitting of data from a CF 3.5 app and a desktop .NET 4 app to simplify the client / Windows CE app so that it simply sends and receives XML or JSON data, rather than connecting to a remote database or so.
However, according to Where to start REST web service in C# or ASP.Net:
"REST in WCF no longer supported - now it points to ASP"
From the same link:
"ASP.NET Web API is now the Microsoft framework for creating RESTful services.
http://www.asp.net/web-api"
Okay, I think we can do that (WebAPI) - the plan is to host the server/service in IIS; however: Can ASP.NET Web API methods be called from CF 3.5? Does anybody have examples of such?
As long as CF 3.5 can make http requests, then you should be able to make rest calls. Look for HttpWebRequest in CF.
http://msdn.microsoft.com/en-us/library/aa446517.aspx
Look at Microsoft's article Calling WCF Services.
To create your service, you are going to need to Power Toys for .NET Compact Framework 3.5, then turn around after installing that to Download the New NetCFSvcUtil (that is a direct download).
I've created Batch files that I store in my Services folder of my Windows Mobile Project (that way, I can't lose them). The batch file is like this:
** create.bat **
NetCFSvcUtil.exe /l:cs /o:Employee.cs /cb:ServiceModelBase http://cpweb2/mainframe/AcpEmployee.svc?wsdl
pause
NetCFSvcUtil.exe /l:cs /o:Packout.cs /cb:ServiceModelBase http://cpweb2/mainframe/AcpPackout.svc?wsdl
pause
That creates 2 Proxy files for me: One for Employees and one for my Packout service. They both create the same base file, ServiceModelBase, which is just a way for services to throw exceptions.
Adding the pause between steps enables you to read any error messages that are thrown up on the screen before running the next command.

How to create HelloWorld Zend Soap Server & Client over SSL using Self Signed Certificate

I am trying to create a basic SOAP Server over SSL. Before making Web Services available on my Production website, I have to test it on Development system with has got Self Signed Certificate (Whose authentication is a problem right now). Following are the problems I am facing in that regard:
When I try to call https://zendsoap.lan/Zend_Soap_server.php?wsdl
its works fine I can view the wsdl.
But when I try https://zendsoap.lan/Zend_Soap_server.php, I get
this:
SOAP-ERROR: Parsing WSDL: Couldn't load from
'https://zendsoap.lan/Zend_Soap_Server.php?wsdl' : failed to load
external entity "https://zendsoap.lan/Zend_Soap_Server.php?wsdl"
Is that something I should be getting or Some nice looking HTML page
describing the usage of webservice like in NuSoap.
I tried verify_peer=>false as I am running it on dev server so no need to verify my own created certificate, but obviously on production I want the Certificate to be verified.
This thing work fine with NuSoap but most of the stuff in NuSoap is deprecated for our server which is running PHP 5.4.6, So the most reliable solution for me using PHP's SOAP extension. And the reason for me using Zend is we're in process of moving our system from some third party framework to Zend Framework and everyday I get requests from client to add this & that new components, I assumed if I develop every new request from Client using Zend libraries then it will be easy for me in later stages to move to Zend Framework.
openssl is enable and tried with defining local_cert as well, but no Joy.
I hope I made some sense there.
Basically looking for some instruction how to create Self Signed Certificates for this purpose, what should be the code for Server & Client.