Connect to GraphDB instance with rdf4j

269 views Asked by At

I have an exposed GraphDB instance in an ip address and port with http protocol. I want to make it more secure so I decided to expose it through https and a domain (with the port included in it). The problem is when I try to call the instance from Java code with the library rdf4j, if I the ip address and port as repository endpoint the code connects perfectly and adds the statements, nevertheless, if I set the domain as endpoint it returns a timeout. This is the code I am using:

HTTPRepository repository = new HTTPRepository("https://example.com", "repository_name");    
RepositoryConnection dataSource = repository.getConnection();
dataSource.add(statements);

This is the thrown exception:

org.apache.http.conn.HttpHostConnectException: Connect to example.com:80 [example.com/"here there is the resolved ip address"] failed: Connection timed out: connect

Rdf4j uses apache http library which supports https connection. However, in the exception the port 80 is shown, that's make my think it is attacking the port without considering the https at the begining of the address.

If more information is required I can add it.

0

There are 0 answers