Search in sources :

Example 1 with RadSecClientTransport

use of net.jradius.radsec.RadSecClientTransport in project cas by apereo.

the class RadiusClientFactory method newInstance.

/**
 * New instance radius client.
 * Attempts to pre-load authenticators
 * that are defined statically before
 * returning the client.
 *
 * @return the radius client
 */
@SneakyThrows
public RadiusClient newInstance() {
    if (sslContext != null && this.transportType == RadiusClientProperties.RadiusClientTransportTypes.RADSEC) {
        val transport = new RadSecClientTransport(sslContext.getKeyManagers(), sslContext.getTrustManagers());
        transport.setRemoteInetAddress(InetAddress.getByName(this.inetAddress));
        transport.setSharedSecret(sharedSecret);
        transport.setAuthPort(this.authenticationPort);
        transport.setAcctPort(this.accountingPort);
        transport.setSocketTimeout(this.socketTimeout);
        return new RadiusClient(transport);
    }
    return new RadiusClient(InetAddress.getByName(this.inetAddress), this.sharedSecret, this.authenticationPort, this.accountingPort, this.socketTimeout);
}
Also used : lombok.val(lombok.val) RadiusClient(net.jradius.client.RadiusClient) RadSecClientTransport(net.jradius.radsec.RadSecClientTransport) SneakyThrows(lombok.SneakyThrows)

Aggregations

SneakyThrows (lombok.SneakyThrows)1 lombok.val (lombok.val)1 RadiusClient (net.jradius.client.RadiusClient)1 RadSecClientTransport (net.jradius.radsec.RadSecClientTransport)1