Added a callback function to set the master secret on the client