You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by th...@apache.org on 2015/01/15 19:43:45 UTC
svn commit: r1652217 - in /lucene/dev/branches/lucene_solr_5_0: ./ solr/
solr/CHANGES.txt solr/bin/ solr/bin/solr solr/bin/solr.cmd
solr/bin/solr.in.cmd solr/bin/solr.in.sh solr/core/
solr/core/src/java/org/apache/solr/util/SolrCLI.java
Author: thelabdude
Date: Thu Jan 15 18:43:44 2015
New Revision: 1652217
URL: http://svn.apache.org/r1652217
Log:
SOLR-6982: bin/solr and SolrCLI should support SSL-related Java System Properties
Modified:
lucene/dev/branches/lucene_solr_5_0/ (props changed)
lucene/dev/branches/lucene_solr_5_0/solr/ (props changed)
lucene/dev/branches/lucene_solr_5_0/solr/CHANGES.txt (contents, props changed)
lucene/dev/branches/lucene_solr_5_0/solr/bin/ (props changed)
lucene/dev/branches/lucene_solr_5_0/solr/bin/solr
lucene/dev/branches/lucene_solr_5_0/solr/bin/solr.cmd
lucene/dev/branches/lucene_solr_5_0/solr/bin/solr.in.cmd
lucene/dev/branches/lucene_solr_5_0/solr/bin/solr.in.sh
lucene/dev/branches/lucene_solr_5_0/solr/core/ (props changed)
lucene/dev/branches/lucene_solr_5_0/solr/core/src/java/org/apache/solr/util/SolrCLI.java
Modified: lucene/dev/branches/lucene_solr_5_0/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_5_0/solr/CHANGES.txt?rev=1652217&r1=1652216&r2=1652217&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_5_0/solr/CHANGES.txt (original)
+++ lucene/dev/branches/lucene_solr_5_0/solr/CHANGES.txt Thu Jan 15 18:43:44 2015
@@ -660,6 +660,9 @@ Other Changes
* SOLR-6926: "ant example" makes no sense anymore - should be "ant server"
(Ramkumar Aiyengar, Timothy Potter)
+* SOLR-6982: bin/solr and SolrCLI should support SSL-related Java System Properties
+ (Timothy Potter)
+
================== 4.10.3 ==================
Bug Fixes
Modified: lucene/dev/branches/lucene_solr_5_0/solr/bin/solr
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_5_0/solr/bin/solr?rev=1652217&r1=1652216&r2=1652217&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_5_0/solr/bin/solr (original)
+++ lucene/dev/branches/lucene_solr_5_0/solr/bin/solr Thu Jan 15 18:43:44 2015
@@ -112,6 +112,12 @@ fi
# test that Java exists and is executable on this server
$JAVA -version >/dev/null 2>&1 || { echo >&2 "Java is required to run Solr! Please install Java 7 or 8 before running this script."; exit 1; }
+# URL scheme for contacting Solr
+SOLR_URL_SCHEME=http
+if [ -n "$SOLR_SSL_OPTS" ]; then
+ SOLR_URL_SCHEME=https
+fi
+
function print_usage() {
CMD="$1"
ERROR_MSG="$2"
@@ -336,7 +342,7 @@ function run_tool() {
(mkdir -p $DEFAULT_SERVER_DIR/solr-webapp/webapp && cd $DEFAULT_SERVER_DIR/solr-webapp/webapp && jar xf $DEFAULT_SERVER_DIR/webapps/solr.war)
fi
- "$JAVA" -Dlog4j.configuration=file:$DEFAULT_SERVER_DIR/scripts/cloud-scripts/log4j.properties \
+ "$JAVA" $SOLR_SSL_OPTS -Dsolr.install.dir=$SOLR_TIP -Dlog4j.configuration=file:$DEFAULT_SERVER_DIR/scripts/cloud-scripts/log4j.properties \
-classpath "$DEFAULT_SERVER_DIR/solr-webapp/webapp/WEB-INF/lib/*:$DEFAULT_SERVER_DIR/lib/ext/*" \
org.apache.solr.util.SolrCLI $*
@@ -355,7 +361,7 @@ function get_info() {
port=`jetty_port "$ID"`
if [ "$port" != "" ]; then
echo -e "\nSolr process $ID running on port $port"
- run_tool status -solr http://localhost:$port/solr
+ run_tool status -solr $SOLR_URL_SCHEME://localhost:$port/solr
echo ""
else
echo -e "\nSolr process $ID from $PIDF not found."
@@ -372,7 +378,7 @@ function get_info() {
if [ "$port" != "" ]; then
echo ""
echo "Solr process $ID running on port $port"
- run_tool status -solr http://localhost:$port/solr
+ run_tool status -solr $SOLR_URL_SCHEME://localhost:$port/solr
echo ""
fi
done
@@ -395,7 +401,7 @@ function stop_solr() {
if [ "$SOLR_PID" != "" ]; then
echo -e "Sending stop command to Solr running on port $SOLR_PORT ... waiting 5 seconds to allow Jetty process $SOLR_PID to stop gracefully."
- $JAVA -jar $DIR/start.jar STOP.PORT=$STOP_PORT STOP.KEY=$STOP_KEY --stop || true
+ $JAVA $SOLR_SSL_OPTS -jar $DIR/start.jar STOP.PORT=$STOP_PORT STOP.KEY=$STOP_KEY --stop || true
(sleep 5) &
spinner $!
rm -f $SOLR_PID_DIR/solr-$SOLR_PORT.pid
@@ -627,14 +633,14 @@ if [[ "$SCRIPT_CMD" == "create" || "$SCR
fi
if [ "$SCRIPT_CMD" == "create_core" ]; then
- run_tool create_core -name $CREATE_NAME -solrUrl http://localhost:$CREATE_PORT/solr \
+ run_tool create_core -name $CREATE_NAME -solrUrl $SOLR_URL_SCHEME://localhost:$CREATE_PORT/solr \
-confdir $CREATE_CONFDIR -configsetsDir $SOLR_TIP/server/solr/configsets
exit $?
else
run_tool $SCRIPT_CMD -name $CREATE_NAME -shards $CREATE_NUM_SHARDS -replicationFactor $CREATE_REPFACT \
-confname $CREATE_CONFNAME -confdir $CREATE_CONFDIR \
-configsetsDir $SOLR_TIP/server/solr/configsets \
- -solrUrl http://localhost:$CREATE_PORT/solr
+ -solrUrl $SOLR_URL_SCHEME://localhost:$CREATE_PORT/solr
exit $?
fi
fi
@@ -1139,6 +1145,16 @@ function launch_solr() {
fi
fi
+ # If SSL-related system props are set, add them to SOLR_OPTS
+ if [ -n "$SOLR_SSL_OPTS" ]; then
+ # If using SSL and jetty.ssl.port not set explicitly, use the jetty.port
+ SSL_PORT_PROP="-Djetty.ssl.port=$SOLR_PORT"
+ if [ -n "$SOLR_SSL_PORT" ]; then
+ SSL_PORT_PROP="-Djetty.ssl.port=$SOLR_SSL_PORT"
+ fi
+ SOLR_OPTS="$SOLR_OPTS $SOLR_SSL_OPTS $SSL_PORT_PROP"
+ fi
+
if $verbose ; then
echo -e "\nStarting Solr using the following settings:"
echo -e " JAVA = $JAVA"
@@ -1248,17 +1264,17 @@ if [ "$EXAMPLE" != "cloud" ]; then
run_tool create -name $EXAMPLE_NAME -shards 1 -replicationFactor 1 \
-confname $EXAMPLE_NAME -confdir $EXAMPLE_CONFIGSET \
- -configsetsDir $SOLR_TIP/server/solr/configsets -solrUrl http://localhost:$SOLR_PORT/solr
+ -configsetsDir $SOLR_TIP/server/solr/configsets -solrUrl $SOLR_URL_SCHEME://localhost:$SOLR_PORT/solr
if [ $? -ne 0 ]; then
exit 1
fi
if [ "$EXAMPLE" == "techproducts" ]; then
echo "Indexing tech product example docs from $SOLR_TIP/example/exampledocs"
- "$JAVA" -Durl=http://localhost:$SOLR_PORT/solr/$EXAMPLE/update -jar $SOLR_TIP/example/exampledocs/post.jar $SOLR_TIP/example/exampledocs/*.xml
+ "$JAVA" $SOLR_SSL_OPTS -Durl=$SOLR_URL_SCHEME://localhost:$SOLR_PORT/solr/$EXAMPLE/update -jar $SOLR_TIP/example/exampledocs/post.jar $SOLR_TIP/example/exampledocs/*.xml
fi
- echo -e "\nSolr $EXAMPLE example launched successfully. Direct your Web browser to http://localhost:$SOLR_PORT/solr to visit the Solr Admin UI\n"
+ echo -e "\nSolr $EXAMPLE example launched successfully. Direct your Web browser to $SOLR_URL_SCHEME://localhost:$SOLR_PORT/solr to visit the Solr Admin UI\n"
fi
else
#
@@ -1371,9 +1387,9 @@ else
run_tool create_collection -name $CLOUD_COLLECTION -shards $CLOUD_NUM_SHARDS -replicationFactor $CLOUD_REPFACT \
-confname $CLOUD_COLLECTION -confdir $CLOUD_CONFIG \
- -configsetsDir $SOLR_TIP/server/solr/configsets -solrUrl http://localhost:$SOLR_PORT/solr
+ -configsetsDir $SOLR_TIP/server/solr/configsets -solrUrl $SOLR_URL_SCHEME://localhost:$SOLR_PORT/solr
- echo -e "\n\nSolrCloud example running, please visit http://localhost:$SOLR_PORT/solr \n\n"
+ echo -e "\n\nSolrCloud example running, please visit $SOLR_URL_SCHEME://localhost:$SOLR_PORT/solr \n\n"
fi
exit $?
Modified: lucene/dev/branches/lucene_solr_5_0/solr/bin/solr.cmd
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_5_0/solr/bin/solr.cmd?rev=1652217&r1=1652216&r2=1652217&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_5_0/solr/bin/solr.cmd (original)
+++ lucene/dev/branches/lucene_solr_5_0/solr/bin/solr.cmd Thu Jan 15 18:43:44 2015
@@ -36,6 +36,11 @@ REM command line args
IF "%SOLR_INCLUDE%"=="" set "SOLR_INCLUDE=%SOLR_TIP%\bin\solr.in.cmd"
IF EXIST "%SOLR_INCLUDE%" CALL "%SOLR_INCLUDE%"
+REM URL scheme for contacting Solr
+set SOLR_URL_SCHEME=http
+IF DEFINED SOLR_SSL_OPTS set SOLR_URL_SCHEME=https
+IF NOT DEFINED SOLR_SSL_OPTS set SOLR_SSL_OPTS=
+
REM Verify Java is available
IF DEFINED SOLR_JAVA_HOME set "JAVA_HOME=%SOLR_JAVA_HOME%"
REM Try to detect JAVA_HOME from the registry
@@ -584,7 +589,7 @@ IF "%SCRIPT_CMD%"=="stop" (
for /f "tokens=2,5" %%j in ('netstat -aon ^| find /i "listening" ^| find ":!SOME_SOLR_PORT!"') do (
@echo Stopping Solr running on port !SOME_SOLR_PORT!
set /A STOP_PORT=!SOME_SOLR_PORT! - 1000
- "%JAVA%" -jar "%SOLR_SERVER_DIR%\start.jar" STOP.PORT=!STOP_PORT! STOP.KEY=%STOP_KEY% --stop
+ "%JAVA%" %SOLR_SSL_OPTS% -Djetty.home="%SOLR_SERVER_DIR%" -jar "%SOLR_SERVER_DIR%\start.jar" STOP.PORT=!STOP_PORT! STOP.KEY=%STOP_KEY% --stop
del %SOLR_TIP%\bin\solr-!SOME_SOLR_PORT!.port
timeout /T 5
REM Kill it if it is still running after the graceful shutdown
@@ -602,7 +607,7 @@ IF "%SCRIPT_CMD%"=="stop" (
set found_it=1
@echo Stopping Solr running on port %SOLR_PORT%
set /A STOP_PORT=%SOLR_PORT% - 1000
- "%JAVA%" -jar "%SOLR_SERVER_DIR%\start.jar" STOP.PORT=!STOP_PORT! STOP.KEY=%STOP_KEY% --stop
+ "%JAVA%" %SOLR_SSL_OPTS% -Djetty.home="%SOLR_SERVER_DIR%" -jar "%SOLR_SERVER_DIR%\start.jar" STOP.PORT=!STOP_PORT! STOP.KEY=%STOP_KEY% --stop
del %SOLR_TIP%\bin\solr-%SOLR_PORT%.port
timeout /T 5
REM Kill it if it is still running after the graceful shutdown
@@ -740,6 +745,11 @@ IF NOT "%REMOTE_JMX_OPTS%"=="" set "STAR
IF NOT "%SOLR_ADDL_ARGS%"=="" set "START_OPTS=%START_OPTS% %SOLR_ADDL_ARGS%"
IF NOT "%SOLR_HOST_ARG%"=="" set "START_OPTS=%START_OPTS% %SOLR_HOST_ARG%"
IF NOT "%SOLR_OPTS%"=="" set "START_OPTS=%START_OPTS% %SOLR_OPTS%"
+IF NOT "%SOLR_SSL_OPTS%"=="" (
+ set "SSL_PORT_PROP=-Djetty.ssl.port=%SOLR_PORT%"
+ IF DEFINED SOLR_SSL_PORT set "SSL_PORT_PROP=-Djetty.ssl.port=%SOLR_SSL_PORT%"
+ set "START_OPTS=%START_OPTS% %SOLR_SSL_OPTS% !SSL_PORT_PROP!"
+)
IF NOT "%LOG4J_CONFIG%"=="" set "START_OPTS=%START_OPTS% -Dlog4j.configuration=%LOG4J_CONFIG%"
cd "%SOLR_SERVER_DIR%"
@@ -777,14 +787,14 @@ IF "%EXAMPLE%"=="techproducts" (
IF NOT "!CREATE_EXAMPLE_CONFIG!"=="" (
timeout /T 10
IF "%SOLR_MODE%"=="solrcloud" (
- "%JAVA%" -Dlog4j.configuration="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j.properties" ^
+ "%JAVA%" %SOLR_SSL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" -Dlog4j.configuration="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j.properties" ^
-classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^
org.apache.solr.util.SolrCLI create_collection -name !EXAMPLE_NAME! -shards 1 -replicationFactor 1 ^
- -confdir !CREATE_EXAMPLE_CONFIG! -configsetsDir "%SOLR_SERVER_DIR%\solr\configsets" -solrUrl http://localhost:%SOLR_PORT%/solr
+ -confdir !CREATE_EXAMPLE_CONFIG! -configsetsDir "%SOLR_SERVER_DIR%\solr\configsets" -solrUrl !SOLR_URL_SCHEME!://localhost:%SOLR_PORT%/solr
) ELSE (
- "%JAVA%" -Dlog4j.configuration="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j.properties" ^
+ "%JAVA%" %SOLR_SSL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" -Dlog4j.configuration="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j.properties" ^
-classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^
- org.apache.solr.util.SolrCLI create_core -name !EXAMPLE_NAME! -solrUrl http://localhost:%SOLR_PORT%/solr ^
+ org.apache.solr.util.SolrCLI create_core -name !EXAMPLE_NAME! -solrUrl !SOLR_URL_SCHEME!://localhost:%SOLR_PORT%/solr ^
-confdir !CREATE_EXAMPLE_CONFIG! -configsetsDir "%SOLR_SERVER_DIR%\solr\configsets"
)
)
@@ -792,14 +802,14 @@ IF NOT "!CREATE_EXAMPLE_CONFIG!"=="" (
IF "%EXAMPLE%"=="techproducts" (
@echo.
@echo Indexing tech product example docs from %SOLR_TIP%\example\exampledocs
- "%JAVA%" -Durl=http://localhost:%SOLR_PORT%/solr/%EXAMPLE%/update -jar %SOLR_TIP%/example/exampledocs/post.jar %SOLR_TIP%/example/exampledocs/*.xml
+ "%JAVA%" %SOLR_SSL_OPTS% -Durl=!SOLR_URL_SCHEME!://localhost:%SOLR_PORT%/solr/%EXAMPLE%/update -jar %SOLR_TIP%/example/exampledocs/post.jar %SOLR_TIP%/example/exampledocs/*.xml
)
@echo.
IF NOT "%EXAMPLE%"=="" (
@echo Solr %EXAMPLE% example launched successfully.
)
-@echo Direct your Web browser to http://localhost:%SOLR_PORT%/solr to visit the Solr Admin UI
+@echo Direct your Web browser to !SOLR_URL_SCHEME!://localhost:%SOLR_PORT%/solr to visit the Solr Admin UI
@echo.
goto done
@@ -948,13 +958,13 @@ echo !CLOUD_CONFIG!
goto create_collection
:create_collection
-"%JAVA%" -Dlog4j.configuration="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j.properties" ^
+"%JAVA%" %SOLR_SSL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" -Dlog4j.configuration="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j.properties" ^
-classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^
org.apache.solr.util.SolrCLI create_collection -name !CLOUD_COLLECTION! -shards !CLOUD_NUM_SHARDS! -replicationFactor !CLOUD_REPFACT! ^
-confdir !CLOUD_CONFIG! -configsetsDir "%SOLR_SERVER_DIR%\solr\configsets" -zkHost %zk_host%
echo.
-echo SolrCloud example is running, please visit http://localhost:%NODE1_PORT%/solr"
+echo SolrCloud example is running, please visit !SOLR_URL_SCHEME!://localhost:%NODE1_PORT%/solr"
echo.
REM End of interactive cloud example
@@ -973,9 +983,9 @@ for /f "usebackq" %%i in (`dir /b %SOLR_
@echo.
set has_info=1
echo Found Solr process %%k running on port !SOME_SOLR_PORT!
- "%JAVA%" -Dlog4j.configuration="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j.properties" ^
+ "%JAVA%" %SOLR_SSL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" -Dlog4j.configuration="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j.properties" ^
-classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^
- org.apache.solr.util.SolrCLI status -solr http://localhost:!SOME_SOLR_PORT!/solr
+ org.apache.solr.util.SolrCLI status -solr !SOLR_URL_SCHEME!://localhost:!SOME_SOLR_PORT!/solr
@echo.
)
)
@@ -1011,7 +1021,7 @@ goto parse_healthcheck_args
:run_healthcheck
IF NOT DEFINED HEALTHCHECK_COLLECTION goto healthcheck_usage
IF NOT DEFINED HEALTHCHECK_ZK_HOST set "HEALTHCHECK_ZK_HOST=localhost:9983"
-"%JAVA%" -Dlog4j.configuration="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j.properties" ^
+"%JAVA%" %SOLR_SSL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" -Dlog4j.configuration="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j.properties" ^
-classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^
org.apache.solr.util.SolrCLI healthcheck -collection !HEALTHCHECK_COLLECTION! -zkHost !HEALTHCHECK_ZK_HOST!
goto done
@@ -1100,15 +1110,15 @@ if "!CREATE_PORT!"=="" (
)
if "%SCRIPT_CMD%"=="create_core" (
- "%JAVA%" -Dlog4j.configuration="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j.properties" ^
+ "%JAVA%" %SOLR_SSL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" -Dlog4j.configuration="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j.properties" ^
-classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^
- org.apache.solr.util.SolrCLI create_core -name !CREATE_NAME! -solrUrl http://localhost:!CREATE_PORT!/solr ^
+ org.apache.solr.util.SolrCLI create_core -name !CREATE_NAME! -solrUrl !SOLR_URL_SCHEME!://localhost:!CREATE_PORT!/solr ^
-confdir !CREATE_CONFDIR! -configsetsDir "%SOLR_TIP%\server\solr\configsets"
) else (
- "%JAVA%" -Dlog4j.configuration="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j.properties" ^
+ "%JAVA%" %SOLR_SSL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" -Dlog4j.configuration="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j.properties" ^
-classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^
org.apache.solr.util.SolrCLI create -name !CREATE_NAME! -shards !CREATE_NUM_SHARDS! -replicationFactor !CREATE_REPFACT! ^
- -confname !CREATE_CONFNAME! -confdir !CREATE_CONFDIR! -configsetsDir "%SOLR_TIP%\server\solr\configsets" -solrUrl http://localhost:!CREATE_PORT!/solr
+ -confname !CREATE_CONFNAME! -confdir !CREATE_CONFDIR! -configsetsDir "%SOLR_TIP%\server\solr\configsets" -solrUrl !SOLR_URL_SCHEME!://localhost:!CREATE_PORT!/solr
)
goto done
Modified: lucene/dev/branches/lucene_solr_5_0/solr/bin/solr.in.cmd
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_5_0/solr/bin/solr.in.cmd?rev=1652217&r1=1652216&r2=1652217&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_5_0/solr/bin/solr.in.cmd (original)
+++ lucene/dev/branches/lucene_solr_5_0/solr/bin/solr.in.cmd Thu Jan 15 18:43:44 2015
@@ -79,3 +79,11 @@ REM set SOLR_HOME=
REM Sets the port Solr binds to, default is 8983
REM set SOLR_PORT=8983
+
+REM Uncomment to set SSL-related system properties
+REM Be sure to update the paths to the correct keystore for your environment
+REM set SOLR_SSL_OPTS=-Djavax.net.ssl.keyStore=etc/solr-ssl.keystore.jks -Djavax.net.ssl.keyStorePassword=secret -Djavax.net.ssl.trustStore=etc/solr-ssl.keystore.jks -Djavax.net.ssl.trustStorePassword=secret
+
+REM Uncomment to set a specific SSL port (-Djetty.ssl.port=N); if not set
+REM and you are using SSL, then the start script will use SOLR_PORT for the SSL port
+REM set SOLR_SSL_PORT=
Modified: lucene/dev/branches/lucene_solr_5_0/solr/bin/solr.in.sh
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_5_0/solr/bin/solr.in.sh?rev=1652217&r1=1652216&r2=1652217&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_5_0/solr/bin/solr.in.sh (original)
+++ lucene/dev/branches/lucene_solr_5_0/solr/bin/solr.in.sh Thu Jan 15 18:43:44 2015
@@ -91,3 +91,13 @@ ENABLE_REMOTE_JMX_OPTS="false"
# Sets the port Solr binds to, default is 8983
#SOLR_PORT=8983
+# Uncomment to set SSL-related system properties
+# Be sure to update the paths to the correct keystore for your environment
+#SOLR_SSL_OPTS="-Djavax.net.ssl.keyStore=etc/solr-ssl.keystore.jks \
+#-Djavax.net.ssl.keyStorePassword=secret \
+#-Djavax.net.ssl.trustStore=etc/solr-ssl.keystore.jks \
+#-Djavax.net.ssl.trustStorePassword=secret"
+
+# Uncomment to set a specific SSL port (-Djetty.ssl.port=N); if not set
+# and you are using SSL, then the start script will use SOLR_PORT for the SSL port
+#SOLR_SSL_PORT=
Modified: lucene/dev/branches/lucene_solr_5_0/solr/core/src/java/org/apache/solr/util/SolrCLI.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_5_0/solr/core/src/java/org/apache/solr/util/SolrCLI.java?rev=1652217&r1=1652216&r2=1652217&view=diff
==============================================================================
--- lucene/dev/branches/lucene_solr_5_0/solr/core/src/java/org/apache/solr/util/SolrCLI.java (original)
+++ lucene/dev/branches/lucene_solr_5_0/solr/core/src/java/org/apache/solr/util/SolrCLI.java Thu Jan 15 18:43:44 2015
@@ -192,9 +192,36 @@ public class SolrCLI {
CommandLine cli =
processCommandLineArgs(joinCommonAndToolOptions(tool.getOptions()), toolArgs);
+ // for SSL support, try to accommodate relative paths set for SSL store props
+ String solrInstallDir = System.getProperty("solr.install.dir");
+ if (solrInstallDir != null) {
+ checkSslStoreSysProp(solrInstallDir, "keyStore");
+ checkSslStoreSysProp(solrInstallDir, "trustStore");
+ }
+
// run the tool
System.exit(tool.runTool(cli));
}
+
+ protected static void checkSslStoreSysProp(String solrInstallDir, String key) {
+ String sysProp = "javax.net.ssl."+key;
+ String keyStore = System.getProperty(sysProp);
+ if (keyStore == null)
+ return;
+
+ File keyStoreFile = new File(keyStore);
+ if (keyStoreFile.isFile())
+ return; // configured setting is OK
+
+ keyStoreFile = new File(solrInstallDir, "server/"+keyStore);
+ if (keyStoreFile.isFile()) {
+ System.setProperty(sysProp, keyStoreFile.getAbsolutePath());
+ } else {
+ System.err.println("WARNING: "+sysProp+" file "+keyStore+
+ " not found! https requests to Solr will likely fail; please update your "+
+ sysProp+" setting to use an absolute path.");
+ }
+ }
/**
* Support options common to all tools.
@@ -882,7 +909,7 @@ public class SolrCLI {
if (collection == null)
throw new IllegalArgumentException("Must provide a collection to run a healthcheck against!");
- log.info("Running healthcheck for "+collection);
+ log.debug("Running healthcheck for "+collection);
ZkStateReader zkStateReader = cloudSolrClient.getZkStateReader();