Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-21642

Use FQDN for DRIVER_HOST_ADDRESS instead of ip address


    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0, 2.2.0
    • Fix Version/s: 2.3.0
    • Component/s: Spark Core
    • Labels:


      In current implementation, ip address of a driver host is set to DRIVER_HOST_ADDRESS [1]. This becomes a problem when we enable SSL using "spark.ssl.enabled", "spark.ssl.trustStore" and "spark.ssl.keyStore" properties. When we configure these properties, spark web ui is launched with SSL enabled and the HTTPS server is configured with the custom SSL certificate you configured in these properties.

      In this case, client gets javax.net.ssl.SSLPeerUnverifiedException exception when the client accesses the spark web ui because the client fails to verify the SSL certificate (Common Name of the SSL cert does not match with DRIVER_HOST_ADDRESS).
      To avoid the exception, we should use FQDN of the driver host for DRIVER_HOST_ADDRESS.

      [1] https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/internal/config/package.scala#L222

      Error message that client gets when the client accesses spark web ui:
      javax.net.ssl.SSLPeerUnverifiedException: Certificate for <> doesn't match any of the subject alternative names: []

      $ spark-submit /path/to/jar
      17/08/04 14:48:07 INFO Utils: Successfully started service 'SparkUI' on port 4040.
      17/08/04 14:48:07 INFO SparkUI: Bound SparkUI to, and started at
      $ curl -I
      HTTP/1.1 302 Found
      Date: Fri, 04 Aug 2017 14:48:20 GMT
      Content-Length: 0
      Server: Jetty(9.2.z-SNAPSHOT)
      $ curl -v
      * Rebuilt URL to:
      *   Trying
      * TCP_NODELAY set
      * Connected to ( port 4440 (#0)
      * Initializing NSS with certpath: sql:/etc/pki/nssdb
      *   CAfile: /etc/pki/tls/certs/ca-bundle.crt
        CApath: none
      * Server certificate:
      * 	subject: CN=*.example.com,OU=MyDept,O=MyOrg,L=Area,C=US
      * 	start date: Jun 12 00:05:02 2017 GMT
      * 	expire date: Jun 12 00:05:02 2018 GMT
      * 	common name: *.example.com
      * 	issuer: CN=*.example.com,OU=MyDept,O=MyOrg,L=Area,C=US




            • Assignee:
              tanakahda Aki Tanaka
              tanakahda Aki Tanaka
            • Votes:
              0 Vote for this issue
              4 Start watching this issue


              • Created: