Repository: guacamole-client
Updated Branches:
  refs/heads/master 6ed4dcdea -> 6b0f31053


GUACAMOLE-197: Use FileGuacamoleProperty for CA and Key file propeties.


Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/18084c20
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/18084c20
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/18084c20

Branch: refs/heads/master
Commit: 18084c2031ea7bc5cbbd3b704e01efba8fe889eb
Parents: 6ed4dcd
Author: Nick Couchman <vn...@apache.org>
Authored: Fri Feb 2 10:59:28 2018 -0500
Committer: Nick Couchman <vn...@apache.org>
Committed: Fri Feb 2 10:59:28 2018 -0500

----------------------------------------------------------------------
 .../guacamole/auth/radius/ConfigurationService.java      | 10 ++++++----
 .../guacamole/auth/radius/RadiusConnectionService.java   | 11 ++++-------
 .../guacamole/auth/radius/RadiusGuacamoleProperties.java |  5 +++--
 3 files changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/18084c20/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/ConfigurationService.java
----------------------------------------------------------------------
diff --git 
a/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/ConfigurationService.java
 
b/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/ConfigurationService.java
index 97cc39c..381ea13 100644
--- 
a/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/ConfigurationService.java
+++ 
b/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/ConfigurationService.java
@@ -20,6 +20,7 @@
 package org.apache.guacamole.auth.radius;
 
 import com.google.inject.Inject;
+import java.io.File;
 import org.apache.guacamole.GuacamoleException;
 import org.apache.guacamole.environment.Environment;
 
@@ -176,9 +177,10 @@ public class ConfigurationService {
      * @throws GuacamoleException
      *     If guacamole.properties cannot be parsed.
      */
-    public String getRadiusCAFile() throws GuacamoleException {
+    public File getRadiusCAFile() throws GuacamoleException {
         return environment.getProperty(
-            RadiusGuacamoleProperties.RADIUS_CA_FILE
+            RadiusGuacamoleProperties.RADIUS_CA_FILE,
+            new File(environment.getGuacamoleHome(), "ca.crt")
         );
     }
 
@@ -195,10 +197,10 @@ public class ConfigurationService {
      * @throws GuacamoleException
      *     If guacamole.properties cannot be parsed.
      */
-    public String getRadiusKeyFile() throws GuacamoleException {
+    public File getRadiusKeyFile() throws GuacamoleException {
         return environment.getProperty(
             RadiusGuacamoleProperties.RADIUS_KEY_FILE,
-            "radius.pem"
+            new File(environment.getGuacamoleHome(), "radius.key")
         );
     }
 

http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/18084c20/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/RadiusConnectionService.java
----------------------------------------------------------------------
diff --git 
a/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/RadiusConnectionService.java
 
b/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/RadiusConnectionService.java
index c73bf66..43c0b2d 100644
--- 
a/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/RadiusConnectionService.java
+++ 
b/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/RadiusConnectionService.java
@@ -27,7 +27,6 @@ import java.net.UnknownHostException;
 import java.security.NoSuchAlgorithmException;
 import org.apache.guacamole.GuacamoleException;
 import org.apache.guacamole.GuacamoleServerException;
-import org.apache.guacamole.environment.LocalEnvironment;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import net.jradius.client.RadiusClient;
@@ -136,15 +135,13 @@ public class RadiusConnectionService {
             radAuth instanceof EAPTTLSAuthenticator) {
 
             // Pull TLS configuration parameters from guacamole.properties
-            LocalEnvironment guacEnv = new LocalEnvironment();
-            File guacHome = guacEnv.getGuacamoleHome();
-            String caFile = confService.getRadiusCAFile();
+            File caFile = confService.getRadiusCAFile();
             String caPassword = confService.getRadiusCAPassword();
-            String keyFile = confService.getRadiusKeyFile();
+            File keyFile = confService.getRadiusKeyFile();
             String keyPassword = confService.getRadiusKeyPassword();
 
             if (caFile != null) {
-                ((EAPTLSAuthenticator)radAuth).setCaFile((new File(guacHome, 
caFile)).toString());
+                ((EAPTLSAuthenticator)radAuth).setCaFile(caFile.toString());
                 
((EAPTLSAuthenticator)radAuth).setCaFileType(confService.getRadiusCAType());
                 if (caPassword != null)
                     ((EAPTLSAuthenticator)radAuth).setCaPassword(caPassword);
@@ -153,7 +150,7 @@ public class RadiusConnectionService {
             if (keyPassword != null)
                 ((EAPTLSAuthenticator)radAuth).setKeyPassword(keyPassword);
 
-            ((EAPTLSAuthenticator)radAuth).setKeyFile((new File(guacHome, 
keyFile)).toString());
+            ((EAPTLSAuthenticator)radAuth).setKeyFile(keyFile.toString());
             
((EAPTLSAuthenticator)radAuth).setKeyFileType(confService.getRadiusKeyType());
             
((EAPTLSAuthenticator)radAuth).setTrustAll(confService.getRadiusTrustAll());
         }

http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/18084c20/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/RadiusGuacamoleProperties.java
----------------------------------------------------------------------
diff --git 
a/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/RadiusGuacamoleProperties.java
 
b/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/RadiusGuacamoleProperties.java
index 144d824..aaa445e 100644
--- 
a/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/RadiusGuacamoleProperties.java
+++ 
b/extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/RadiusGuacamoleProperties.java
@@ -20,6 +20,7 @@
 package org.apache.guacamole.auth.radius;
 
 import org.apache.guacamole.properties.BooleanGuacamoleProperty;
+import org.apache.guacamole.properties.FileGuacamoleProperty;
 import org.apache.guacamole.properties.IntegerGuacamoleProperty;
 import org.apache.guacamole.properties.StringGuacamoleProperty;
 
@@ -110,7 +111,7 @@ public class RadiusGuacamoleProperties {
     /**
      * The CA file to use to validate RADIUS server certificates.
      */
-    public static final StringGuacamoleProperty RADIUS_CA_FILE = new 
StringGuacamoleProperty() {
+    public static final FileGuacamoleProperty RADIUS_CA_FILE = new 
FileGuacamoleProperty() {
 
         @Override
         public String getName() { return "radius-ca-file"; }
@@ -140,7 +141,7 @@ public class RadiusGuacamoleProperties {
     /**
      * The file that stores the key/certificate pair to use for the RADIUS 
client connection.
      */
-    public static final StringGuacamoleProperty RADIUS_KEY_FILE = new 
StringGuacamoleProperty() {
+    public static final FileGuacamoleProperty RADIUS_KEY_FILE = new 
FileGuacamoleProperty() {
 
         @Override
         public String getName() { return "radius-key-file"; }

Reply via email to