methods of establishing secure communication channels in peer - to - peer environments are provided that eliminate role conflicts between peers by determining which peer will act as a client and which the peer will act as a server in a secure connection handshake . in one embodiment , an attribute of the handshake messages are used in a tiebreaker process to determine which peer assumes the role of the server . in another embodiment , the attribute may be used to compute a wait period for each peer , or the wait period may be based on a random time period , and the peers cancel their request and resent requests after waiting their respective time periods .