A method for a server for enabling a secure set up of a peer-to-peer connection between a first peer and a second peer, wherein at least one of the first peer and the second peer is a web browser, the method comprising the steps of: receiving a request for a web application from the first peer; sending a directive to the first peer requesting a fingerprint of a certificate of the first peer, wherein the directive comprises instructing the first peer to submit hash values for each certificate used with any peer-to-peer connections associated with the web application; receiving a request for the web application from the second peer; sending a directive to the second peer requesting a fingerprint of a certificate of the second peer, wherein the directive comprises sending a directive to instruct the second peer to submit hash values for each certificate used with any peer-to-peer connections associated with the web application; in response to the directive sent to the first peer, receiving a first fingerprint, including a respective hash value of each certificate in use in the context for the web application, from the first peer; receiving a first configuration information from the first peer for establishing a peer-to-peer connection for the first peer to the second peer, wherein the configuration information comprises hash values of certificates of the first peer to be used for the peer-to-peer connection; validating the hash values of certificates comprised in the first configuration information by comparing whether the hash values of certificates comprised in the first configuration information matches the respective hash value of each certificate include in the first fingerprint; sending the first configuration information to the second peer if the hash values of certificates comprised in the first configuration information are validated; in response to the directive sent to the second peer, receiving a second fingerprint, including a respective hash value of each certificate in use in the context for the web application, from the second peer; in response to sending the first configuration information, receiving a second configuration information from the second peer for establishing a peer-to-peer connection for the first peer to the second peer, wherein the second configuration information comprises hash values of certificates of the second peer to be used for the peer-to-peer connection; validating the hash values of certificates comprised in the second configuration information by comparing whether the hash values of certificates comprised in the second configuration information matches the respective hash value of each certificate include in the second fingerprint; sending the second configuration information to the first peer if the hash values of certificates comprised in the second configuration information are validated. receiving a request for a web application from the first peer; sending a directive to the first peer requesting a fingerprint of a certificate of the first peer, wherein the directive comprises instructing the first peer to submit hash values for each certificate used with any peer-to-peer connections associated with the web application; receiving a request for the web application from the second peer; sending a directive to the second peer requesting a fingerprint of a certificate of the second peer, wherein the directive comprises sending a directive to instruct the second peer to submit hash values for each certificate used with any peer-to-peer connections associated with the web application; in response to the directive sent to the first peer, receiving a first fingerprint, including a respective hash value of each certificate in use in the context for the web application, from the first peer; receiving a first configuration information from the first peer for establishing a peer-to-peer connection for the first peer to the second peer, wherein the configuration information comprises hash values of certificates of the first peer to be used for the peer-to-peer connection; validating the hash values of certificates comprised in the first configuration information by comparing whether the hash values of certificates comprised in the first configuration information matches the respective hash value of each certificate include in the first fingerprint; sending the first configuration information to the second peer if the hash values of certificates comprised in the first configuration information are validated; in response to the directive sent to the second peer, receiving a second fingerprint, including a respective hash value of each certificate in use in the context for the web application, from the second peer; in response to sending the first configuration information, receiving a second configuration information from the second peer for establishing a peer-to-peer connection for the first peer to the second peer, wherein the second configuration information comprises hash values of certificates of the second peer to be used for the peer-to-peer connection; validating the hash values of certificates comprised in the second configuration information by comparing whether the hash values of certificates comprised in the second configuration information matches the respective hash value of each certificate include in the second fingerprint; sending the second configuration information to the first peer if the hash values of certificates comprised in the second configuration information are validated.