Adobe Air with sniffer Proxy? - actionscript-3

I usually use Charles Proxy to catch requests/responses in browser. But now I develop Air application for mobile. Even if I run it on my PC Charles doesn`t catch requests of Air.
1) Can I configure Charles Proxy to catch requests/responses outside of browser?
If no:
2) What tool do you use to sniff requests/responses outside of browser?
I have both PC Windows 8 and Mac OS.

Try changing your windows proxy settings to point to Charles. The default proxy settings to point to Charles should be 127.0.0.1 on 8888

Related

Self signed certificate for communication between local Win10 native app and web app

Background: I have a web app that is accessed via Chrome on a Windows 10 machine.
I also have a native Win10 application installed on the device. The web app sends data to the Win10 application via a local web service running on the machine in IISExpress.
To allow for HTTPS communication on port 44300, I've created a self-signed certificate via PowerShell:
New-SelfSignedCertificate -DnsName "localhost" -CertStoreLocation "cert:\LocalMachine\My" -NotAfter (Get-Date).AddMonths(60)
And then imported it to 'Local Computer\Trusted Root Certificates\Certificates'
From within the web app I send a command to the win10 app that looks something like this:
https://localhost:44300/CMTService.svc/JumpToAssignment?Param=Key=418584577
The win10 app is polling for these requests and picks up the message.
Issue:
Different versions of Chrome behave differently with the acceptance of the self-signed certificate. For instance versions 62, 64 and 75 all accept the certificate and allow for communication with the web service. But other versions of Chrome like 76 and 78 block communication. The Security tab in the Chrome DevTools shows https://localhost:44300 as "Unknown / cancelled" and my requests fail with ERR_SSL_CLIENT_AUTH_CERT_NEEDED. Whereas in working versions of Chrome my URL shows under "Secure origins". The only thing that I change is the Chrome version to get these different results.
I've tried enabling the Chrome setting to allow for invalid certs for localhost (chrome://flags/#allow-insecure-localhost). This temporarily works, but then after closing and reopening chrome, my requests start failing again with the same error code.
If I take one of my failing URLs and paste it into a new Chrome tab, suddenly communication with my native app in my web app resumes as normal. But it only works for that session - when I close and reopen Chrome my communication is broken again.
Question:
How do I allow for communication between my Chrome v78 web app and my local native app?
ERR_SSL_CLIENT_AUTH_CERT_NEEDED means the server is asking the browser for a certificate for client authentication.
You've described how you setup server authentication, but not described how you setup client authentication.
Likely you have enabled certificates for client authentication, but have not configured the web app to send the correct client certificate or have not configured the native app to accept the correct client certificate. That's a very open ended topic to be prescriptive without knowing more about your development efforts, but you can confirm if client authentication is enabled by inspecting a packet capture. One description of the handshake is here : https://blogs.technet.microsoft.com/nettracer/2013/12/30/how-it-works-on-the-wire-iis-http-client-certificate-authentication/.
Just an update: I implemented a javascript workaround to get around my communication issues. When first loading the web app, I simply send my first communication to IIS (destined for Win10 native app) in a separate chrome browser tab. For whatever reason this allows for successful acceptance of the certificate and kick starts the communication with IIS. This is my code to send the command in a new tab and then close it:
var inst = window.open(launchWinAppURL);
if (inst != null) {
window.setTimeout(function() {
inst.close();
}, 1000);
}
This is not the most elegant solution, but it seems to work on all chrome versions, so i'm satisfied.
Is the web app only communicating with the one win10 machine? Have you installed the self-signed cert directly to the machine? I would try installing it directly to the machine and see if the later instances of chrome allow communication.

Chrome SPDY error when SSL proxying with Charles Proxy on MacOS

I would like to have Charles decrypt HTTPS traffic when browsing in Chrome on MacOS.
But when I visit a website (for example, https://www.facebook.com), there are errors about net::ERR_SPDY_COMPRESSION_ERROR on multiple resources.
How can I fix this?
Steps I've followed so far:
Open Keychain Access, search for charles and delete every item mentioning charles
Open Charles Proxy, chose Help > SSL Proxying > Save Charles Root Certificate... and save charles-ssl-proxying-certificate.pem
Open Keychain Access again, click File > Import Items..., choose charles-ssl-proxying-certificate.pem, click Open.
Double click on the new certificate, click Trust, then for When using this certificate: select Always Trust
Close the window, and enter my password in the Certificate Trust Settings popup, and click Update Settings
Close Keychain access.
In Charles Proxy, select Proxy > Proxy Settings.... Check Enable SSL Proxying and enter *:* in the Location. Click Ok.
Restart Charles and Chrome.
Enable MacOS Proxy in Charles.
Visit https://www.facebook.com in Chrome incognito window.
I see multiple net::ERR_SPDY_COMPRESSION_ERROR errors in the Chrome Inspector Console.
I also tried the same steps, except using Install Charles Root Certificate from the Charles Proxy Help menu, but it results in the same problem.
Charles 4.0.2
Network: WPA2 WiFi
VPN: no
OS: MacOS 10.12.5
Chrome: 58.0.3029.110
Upgrading Charles to version 4.2.7 solved the problem for me (version 4.0.2 had the problem). I think the fix is included in 4.2.5 improvements: SSL Proxying support extended to Port Forwarding and non-HTTP SOCKS traffic.

Charles proxy not working with Chrome

I am working on Mac and have identical Proxy settings for the System and Firefox browser. However, I am able to see my Firefox traffic in Chrales but I don't see my Chrome and Safari traffic (which use System Proxy Settings). What do I need to do? How can I check the debug this?
Already restarted my browser but it didn't help. I have set and reset proxy settings, but of no use.
One thing to note: I am on a VPN although I don't think this should affect Chrome as Firefox is going through the proxy.
For anyone else using VPN: Charles must be turned on before VPN. So quitting VPN after turning on Charles won't work either.
Also in my case VPN can't be turned on at all.
Did you enable "Proxy-> Mac OS X Proxy"?
Quit your VPN! I was confused almost one year and really upset, i cannot record on my mac.But today i quit my vpn(xx-net) it does works.
Just got caught out with this - the Hola VPN Chrome extension was managing Chrome's proxy settings so it wasn't using the system proxy.
Simply disabling the Hola extension got it working for me again.
I turn off a chrome proxy plugin and it works!
Chrome extension 'SwitchyOmega' can solve the "VPN and Charles cannot turn on at the same time" issue by configure the auto switch option:
Add Charles mode
Add VPN mode
auto switch configuration
Use auto switch mode in Chrome
Desktop applications that set system-wide proxy don't work really well with VPN. I struggled with Charles & Fiddler because I was under a VPN network and almost all the time I couldn't use any of the apps while on my company VPN So I googled for Web Proxy chrome extension and found Requestly.
I am using the Requestly Chrome extension and the chrome extension works well with VPN and it has all the features that Charles has.

windows phone network trace

I'm writing a windows phone 8 app that authenticates to email using httpwebrequest. For some reason I'm getting an authentication error and I need to look at the traffic.
Is there a way to configure visual studio to see the raw http traffic when I debug from my phone?
For example, can I configure fiddler to look at the traffic?
Are there any tricks to print to console the httpwebrequest?
Nothing with Visual Studio.
You can use Fiddler though. Just connect your device to the same WiFi as your PC, on the device Settings > Wifi > long tap on your network and tap Edit. Turn proxy on and type in your PC IP address and use 8888 as port. Open Fiddler and you are done. Remember to go to FIddler settings and allow the detection for remote devices:
Tools > Fiddler options > Connections > Allow remote computers to connect

SignalR Hub connectivity from Windows Phone 8

What I'm trying should be basic; but must be missing something. Have couple of SignalR Hubs defined inside an MVC3 app running locally. Same solution has a Windows Phone 8 & a Windows Store app, both talking to the SignalR hubs for real-time communication. SignalR server uses latest bits & clients use latest .NET nuget.
On the client side, this is what I'm used to writing:
IHubProxy SignalRChatHub;
HubConnection chatConnection = new HubConnection("http://localhost:53478/");
SignalRChatHub = chatConnection.CreateHubProxy("ChatHub");
await chatConnection.Start();
if (chatConnection.State == Microsoft.AspNet.SignalR.Client.ConnectionState.Connected)
{
// Stuff here.
}
This works perfectly fine with a Windows 8 app client & we have easy connectivity with the SignalR hub running locally on IIS. However, the same code does not work for a Windows Phone client. The connection.start() bombs out with a 404 exception.
After a little research, it looks like the WP Emulator VM is treated as a different machine and uses the host machine's network virtually. So, IIS may be blocking calls from outside not allowing reach into the SignalR hub from Windows Phone 8 app. Accordingly, I tweak applicationhost.config for the SignalR server app to allow connectivity from outside localhost. So now, the SignalR hub is functional from both localhost and also off the local IP. Also, the routing has been changed to allow cross-domain SignalR connectivity in Global.asax.cs:
RouteTable.Routes.MapHubs(new HubConfiguration() { EnableCrossDomain = true });
The Windows Phone client code is changed to:
HubConnection chatConnection = new HubConnection("http://<LocalIP>:53478/");
But this continues to fail the connection.start() with a "Remote server returned an error: Not Found" exception. I have Fiddler sniffing network traffic from the phone emulator and shows absolutely nothing in response to the connection.start() call.
What am I missing? Any pointers would be helpful .. thanks!
Figured it out myself. Turns out the SignalR connectivity issue from the WPDev emulator was actually due to IIS/Windows security. Little more IIS config & opening local ports through Windows Firewall fixed the problem. Will blog about it; but these two posts helped:
http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj684580.aspx
https://blogs.iis.net/robert_mcmurray/archive/2013/08/20/connecting-the-windows-phone-8-emulator-to-web-api-applications-on-a-local-computer.aspx