The only future of web applications is with SSL and TLS however this is a nightmare for me and many other web application developers. When we moved all our applications to use secure communications always it became difficult to debug the web application and web api. Luckily Wireshark helps us solve this problem. Currently any secure traffic captured by Wireshark looks like this.

 

a picture showing normal packet capture using WireShark

Normal SSL Traffic Capture

 

The previous versions allowed to decrypt the secure traffic that used RSA only if the private key could be provided to Wireshark but it is no longer possible to decrypt traffic with just the private keys. This is where Session Key Logging comes into the picture. The browsers that we care about (Chrome and Firefox) support logging symmetric session key which is then used by Wireshark to decrypt the secure traffic.

 

Enable Session Key Logging

  • This could be done by simply by adding an environment variable. To add an environmental variable in Windows go to Computer Properties. One way to reach there is by Right-Clicking the My PC and select Properties.

 

a picture showing how to open computer properties

My PC Properties

 

  • Then Select Advanced System Setting

 

a picture showing where to click to open Advanced System Settings

Advanced System Settings

 

 

  • Followed by selecting Environment Variables
a picture showing where to click to open Environment variable sin Windows

Environment Variables

 

  • Now add a new User Environment Variable.

 

a picture showing way to add new user environment variable SSLKEYLOGFILE

SSLKEYLOGFILE User Variable

 

    Note – Restart your browser so that the log file is created.

  • Now that we have our environment variable setup. Let go to Wireshark and configure it read these keys to decrypt traffic. To do that go to Edit –> Preferences

 

a showing where to open wireshark preferences from menu

Wireshark preferences menu

 

  • Navigate to Protocols –> SSL. Browse to the path where you specified the log file to be created and select the file.
a picture showing where to specify the session keys log file in wireshark

wireshark ssl keys

 

  • Now we are all set to decrypt the secure traffic in wireshark. Start capturing traffic with Wireshark and select any TLS or SSL packet to decrypt.

 

a picture showing normal ssl packet details captured by wireshark

Normal SSL Traffic Capture

 

  • But when you move to the Decrypted SSL you would be able to see the decrypted traffic.

 

a picture showing decrypted packet in wireshark

Decrypted Packet

 

Hope this helps you with your work with secure web packets.

 

Any questions, comments and feedback is always welcome.

 

All of us need to capture the screenshot of the browser one time or another and I have used many third party freemium extensions over time but nothing could be as good as something built in to the browser itself.

Chrome now includes a way to capture the screen shot through Dev Tools. To Open Dev Tools Press F12 or  Ctrl + Shift + I or from the hamburger menu in Chrome select More Tools –> Developer Tools

a picture showing how to open Developer Tools in Chrome form hambuger menu

Developer Tools

 

Click on device toggle to select device mode

 

a picture should where to toggle device mode in Chrome

Device Toggle

 

Select the Device to capture the screenshot

a picture showing where to select device in chrome device mode window

Device Select

 

Go to 3 dots menu on the right and select Capture Screenshot.

 

a picture showing where to find the Capture Screenshot option

Capture Screenshot

 

And volla. there you have your screenshot.

 

a picture of the screenshot capture in chrome with device selected as iPhone

Sreenshot iPhone

 

Note – If you not want the device border then you could disable it from the 3 dots menu in the right

 

a picture showing where to hide the device frame in chrome

Hide Device Frame

 

I know what you are thinking. What if I want the screenshot in a desktop / laptop browser size and not a device. There is a simple way to do that. In the Device selection menu select Responsive

 

a picture showing where to select Device as Responsive in Chrome device menu in dev tools

Responsive Device

 

Now drag to resize the area of the responsive device and then click on capture screenshot.

 

a picture showing the points to grab to resize responsive area in chrome device

Resize Device

 

Ans here is your screenshot.

 

a screenshot capture using chrome

Screnshot Responsive

 

Hope this helps you. Any feedback, questions and comments are welcome.

 

In this blog post we are going to talk about the basics and new features in ASP.NET 5 and Visual Studio 2015 by creating our favourite Hello World Program.

Visual Studio 2015 is a File based project system now which means that when we add a file in the file system then it is automatically picked up and a dynamic compilation happens that could result in faster refresh and faster build behind the scenes. This is possible because of the Rosyln compiler https://github.com/dotnet/roslyn.
In the newer version of Visual studio we can develop applications with the full featured .Net framework as well as the Cloud Optimized Core CLR. The idea of designing this new Core CLR is to make the application with fast startup, low memory usage and high throughput (I wonder why this is not the default framework always). Core CLR is designed to work on the  environments other than windows as well like Linux and OSX. Core CLR is available as a nuget package and hence could be deployed as part of the application itself but keep in mind, this being an optimized CLR might be missing types available in the full features .NET framework.

 

The newer version of ASP.NET has taken steps towards unification by combining ASP.NET MVC + WebAPI into one class itself which means that it would have only one base controller for both.

MVC6 WebPage MVC WebAPI

MVC6 WebPage MVC WebAPI

 

MVC 6 does not rely on the System.Web anymore and also the minimum size of the HttpContext is reduced to 2kb from 30kb. Let’s create our favourite project HelloWorld in ASP.NET 5

 

New ASP.NET 5 Project

New ASP.NET 5 Project

Make sure you select the Web Application under ASP.NET 5 Templates. and Uncheck the Host in Cloud checkbox for now.

Hello World ASP.NET 5 Project

Hello World ASP.NET 5 Project

 

Now let’s navigate to the Controllers folder of the project in the File Explorer and create a new file named HellowWorldController.cs

New Controller

New Controller

You would notice that this file is automatically refreshed in the solution

 

File Explorer Sync

File Explorer Sync

Now let’s add some code to this controller to see it in action.

 

Build and run the project by pressing Ctrl + F5 and change the url to call the controller that we just created.

Run ASP.NET 5

Run ASP.NET 5

 

This was certainly less painful as we do not have to remember what files we created in the file system (Not that I do, Git takes care of all that) as Visual Studio automatically takes care of that.

Now if we change the controller and save the file and then refresh the browser, my changes are reflected which was not the case before while working with C# files.

Run ASP.NET 5 After File Save

Run ASP.NET 5 After File Save

 

The root of the website is not longer the root of the project. By default the root of the website is wwwroot folder which contain all the static resources of the Website (including the bin folder for dlls) by default. We can add more static resources here as well. This allows a clear separation between the files that need to deployed to webserver and the configuration files.

 

WebRoot wwwroot

WebRoot wwwroot

By default the views also reference resources from the webroot (~) of the website.

Reference Webroot wwwroot

Reference Webroot wwwroot

 

We could change it by modifying the webroot in the project.json file.We will also notice the new way of declaring dependencies.

Change Webroot wwwroot

Change Webroot wwwroot

However the dependencies that could be added in project.json has be 100% .NET dependencies. We could include these dependencies using the good old Manage Nuget Packages option.

 

Manage Nuget Packages

Manage Nuget Packages

or we could hand type the dependencies in the project.json files itself and intellisense would help us out there. We could specify the version we want to target or add empty string (“”) to use the latest always.

Add nuget reference manually

Add nuget reference manually

Once we do that and save the project.json file we would see that the References section in the solution explorer will show the progress of getting and mapping the package that we just added. And at last building the project.

Auto Build

Auto Build

 

If you look further down in the project.json file you would see in the framework section that both full featured dotnet and dotnet core frameworks have been included. This will make visual studio build the solution against both the framework which could be beneficial when we are supporting multiple frameworks.

 

Target Multiple Frameworks

Target Multiple Frameworks

When we run the project in the local system it would run against only one of the framework so to check which framework we are running against we could go to the project properties we could select the framework.

Select One Framework

Select One Framework

 

When we are working in the solution on anything like say in the HelloWorldController I want to return the current date and time using timezone then we could see the information of availability in intellisence.

Package Availability

Package Availability

 

We could use the # defined symbols to write code against specific frameworks. Like we could use #dnx451 for dotnet framework and #dnxcore50 for core framework.

 

 

Use # directive

Use # directive

Now if you see the in the current solution of the project you would not find the packages that are listed as dependencies. The reason is because they are present under the user profile folder in .dnx folder.

 

Framework Location

Framework Location

When you go inside the .dnx folder you would see the packages folder where all the packages referenced by the current project and all the other projects will be present so that all of them could be reusable.

Packages Location

Packages Location

 

You would also see a runtimes folder where we could see the available runtimes which are x64 and x86 versions of both full dotnet framework and core framework.

 

Runtime Location

Runtime Location

 

Any questions, comments and feedback are always welcome.

Hey guys,

Today I am going to share a program that I wrote sometime back when I was learning to work with Selenium. I had a lot of people commenting and subscribing on my blog and I wanted to figure out if those emails were valid or not so I found out a bunch of websites that could do that for you but I did not want to go through the exercise of copy pasting and verifying one email at a time. So I wrote a selenium program to do that for me.

 

The website did have a bulk purchase program but the minimum that one could purchase was 3000 emails and I needed to verify like a 100 hence automation to the rescue.

To write a program similar to this you would need to know C# and little bit of html/css and working knowledge of selenium

 

I just tried this program recently and found out that it needed a fix. So I have fixed the program and its available on my GitHub page. This would give you a basic infrastructure and knowledge to write a selenium automation. This program is only educational purposes. I request you to not to use it for any other reason.

 

Here are a few screenshots from the program

Start Screen

Start Screen

 

Select Emails To Verify

Select Emails To Verify

 

See App In Action

See App In Action

 

Feel Free to provide your feedback, comments and suggestions

Good News

skillup5usd-logo

 

With more than 3000 eBooks and video courses available across our website for just $5, you need to know where to start. Download our Year in Review and get the bigger picture on tech in 2015 – and find out what’s set to define 2016.

 

You could buy my book Blend for Visual Studio 2012 by Example: Beginner’s Guide for just $5 for a limited time only.

Blend for Visual Studio

Blend for Visual Studio

So what are you waiting for buy now and get skill upgrade.

 

skillup5usd-logo

 

sale1