You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Alexandru Toader <a....@jacobs-university.de> on 2012/11/01 16:01:46 UTC

Data Import from HTTPBasic Authentication secured database

Dear all,

I have just started working with Solr but I have stumbled upon a problem
and I would really appreciate assistance.
I want to use the DataImportHandler to get data from a remote database that
requires Basic HTTP Authentication.
I have tried the following configuration:

<dataConfig>
    <dataSource type="URLDataSource" />
    <document>
        <entity name="slashdot"
                pk="link"
                url="https://user:password@database?"
                processor="XPathEntityProcessor"
                forEach="/doc">

            <field column="id" xpath="/doc/id" />
            <field column="title" xpath="/doc/title" />
         <field column="cd" xpath="/doc/cd" />
            <field column="symbol" xpath="/doc/symbol" />
        </entity>
    </document>
</dataConfig>

The first problem I encountered is that the SSL certificate of the database
is expired and I get multiple exceptions:
javax.net.ssl.SSLHandshakeException:

java.security.cert.CertificateException: No name matching ...
Is there a way to get around this without modifying the source code?
Is it enought to modify the URLDataSource.java to accept all certificates?
Can I modify something so that I can use a configuration of the type:

<dataConfig>
    <dataSource type="URLDataSource" />
    <document>
        <entity name="slashdot"
                pk="link"
                url="https://user:password@database?"
user="user"
password="pass"
processor="XPathEntityProcessor"
                forEach="/doc">

        </entity>
    </document>
</dataConfig>

or a variant of this?

Any help is appreciated. I can provide more information if needed.

Best regards,

Alex