Web script replay is slower in Vugen due to extra authentication

Web script replay is slower in Vugen due to extra authentication

When replaying a web script in Vugen the replay time is longer. On reviewing the replay log and Wireshark traces the reason appears to be due to extra "HTTP/1.1 401 Unauthorized" responses from the server causing an extra authentication. Why is the extra authentication happening in Vugen but not from a web browser ?

One possible cause of this issue is due to a page redirection happening to the same server, but a new connection is made. This can be verified from the replay log as follows.

In the replay log look for the initial http GET request and follow the subsequent requests and responses. In the case of a re-direction an example TCP connection stream may look like this:

Connecting to host <server IP>:<server port>
Connected socket from <client IP>:<Client port> to <Server IP>:<Server port>
Client->Server GET /….
Server->Client HTTP/1.1 401 Unauthorized
Client->Server GET /
Server->Client HTTP/1.1 401 Unauthorized
Client->Server GET /…
Server->Client HTTP/1.1 302 Found
Redirecting "http://……….
To Location "http://……….
Connecting to host <server IP>:<server port>
Connected socket from <client IP>:<Client port> to <Server IP>:<Server port>
client->Server Get /….
Server Client HTTP/1.1 401 Unauthorized
client->Server Get /….
Server Client HTTP/1.1 401 Unauthorized
Client->Server Get /….
Server->Client HTTP/1.1 200 OK

In the above example, if the "<Client port>" changes after the redirection, even though the redirection is to the same server, then a further authentication is enforced and thus the extra authorization sequence and slower replay. This is because a new connection is made to the server and therefore needs authenticating again.

To prevent this behaviour add the following web_set_sockets_option() at the start of the script:

web_set_sockets_option("MAX_CONNECTIONS_PER_HOST","1");

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s