Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-8491

solr.cmd SOLR_SSL_OPTS is overwritten

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.2, 5.3, 5.4, 5.5, 6.0, 6.1, 6.2, 6.3, 6.4
    • 6.4.1, 6.5, 7.0
    • scripts and tools
    • None
    • Windows

    Description

      In solr.cmd, the SOLR_SSL_OPTS variable is assigned within a block, but then assigned again later in the same block, using %SOLR_SSL_OPTS% to attempt to append to itself. However, since we're still inside the same block for this 2nd assignment, %SOLR_SSL_OPTS% resolves to nothing, so everything in the first assignment (the solr.jetty opts) becomes overwritten.

      I was able to work around this by using

      !SOLR_SSL_OPTS!

      instead of %SOLR_SSL_OPTS% in the 2nd assignments (in both the IF and ELSE blocks), since delayed expension is enabled.

      Here's the full block for reference, from commit d4e3f50a6f6bc7b96fa6317f028ae26be25c8928, lines 43-55:

      IF DEFINED SOLR_SSL_KEY_STORE (
        set "SOLR_JETTY_CONFIG=--module=https"
        set SOLR_URL_SCHEME=https
        set "SCRIPT_ERROR=Solr server directory %SOLR_SERVER_DIR% not found!"
        set "SOLR_SSL_OPTS=-Dsolr.jetty.keystore=%SOLR_SSL_KEY_STORE% -Dsolr.jetty.keystore.password=%SOLR_SSL_KEY_STORE_PASSWORD% -Dsolr.jetty.truststore=%SOLR_SSL_TRUST_STORE% -Dsolr.jetty.truststore.password=%SOLR_SSL_TRUST_STORE_PASSWORD% -Dsolr.jetty.ssl.needClientAuth=%SOLR_SSL_NEED_CLIENT_AUTH% -Dsolr.jetty.ssl.wantClientAuth=%SOLR_SSL_WANT_CLIENT_AUTH%"
        IF DEFINED SOLR_SSL_CLIENT_KEY_STORE  (
          set "SOLR_SSL_OPTS=%SOLR_SSL_OPTS% -Djavax.net.ssl.keyStore=%SOLR_SSL_CLIENT_KEY_STORE% -Djavax.net.ssl.keyStorePassword=%SOLR_SSL_CLIENT_KEY_STORE_PASSWORD% -Djavax.net.ssl.trustStore=%SOLR_SSL_CLIENT_TRUST_STORE% -Djavax.net.ssl.trustStorePassword=%SOLR_SSL_CLIENT_TRUST_STORE_PASSWORD%"
        ) ELSE (
          set "SOLR_SSL_OPTS=%SOLR_SSL_OPTS% -Djavax.net.ssl.keyStore=%SOLR_SSL_KEY_STORE% -Djavax.net.ssl.keyStorePassword=%SOLR_SSL_KEY_STORE_PASSWORD% -Djavax.net.ssl.trustStore=%SOLR_SSL_TRUST_STORE% -Djavax.net.ssl.trustStorePassword=%SOLR_SSL_TRUST_STORE_PASSWORD%"
        )
      ) ELSE (
        set SOLR_SSL_OPTS=
      )
      

      Attachments

        1. SOLR-8491.patch
          5 kB
          Kevin Risden

        Issue Links

          Activity

            People

              krisden Kevin Risden
              illojones Sam Yi
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: