1. A method of providing connection security for a connection between terminals in a wireless network, in which connection a security protocol layer for connection security function is above a transport protocol layer and below an application protocol layer, the method including the following steps: transmitting data from a first terminal (MS1) via nodes in the network to a second terminal (MS2), characterized in that the method further includes the steps of: storing information about the subscriber security method of at least the first and the second terminal (MS1 and MS2) in a database (DB), wherein the information in the database (DB) about the subscriber security method includes security layer protocols of the terminals, routing the transmitted data via a mediator (MD), using a first security method for providing connection security at the security protocol layer between the first terminal (MS1) and the mediator (MD), using a second security method for providing connection security at the security protocol layer between the mediator (MD) and the second terminal (MS2), and performing security method conversion at the security protocol layer at the mediator (MD).