Index: modules/dnet-download-service/trunk/src/test/java/DownloadWorkerTest.java
===================================================================
--- modules/dnet-download-service/trunk/src/test/java/DownloadWorkerTest.java	(nonexistent)
+++ modules/dnet-download-service/trunk/src/test/java/DownloadWorkerTest.java	(revision 45027)
@@ -0,0 +1,68 @@
+import java.security.Security;
+
+import com.google.common.base.Function;
+import eu.dnetlib.data.download.DownloadReportMap;
+import eu.dnetlib.data.download.rmi.DownloadItem;
+import eu.dnetlib.data.download.worker.DownloadWorker;
+import eu.dnetlib.data.objectstore.modular.ObjectStoreRecord;
+import eu.dnetlib.data.objectstore.modular.connector.ObjectStore;
+import eu.dnetlib.data.objectstore.rmi.Protocols;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Matchers.any;
+import static org.mockito.Mockito.when;
+
+/**
+ * Created by alessia on 22/12/16.
+ */
+@RunWith(MockitoJUnitRunner.class)
+public class DownloadWorkerTest {
+
+	private DownloadWorker dw;
+	private DownloadReportMap reportMap;
+	@Mock
+	private ObjectStore objectStore;
+
+	@Before
+	public void prepare() throws Exception{
+		Security.insertProviderAt(new BouncyCastleProvider(),1);
+		System.setProperty("https.protocols", "TLSv1,TLSv1.1,TLSv1.2");
+		reportMap = new DownloadReportMap();
+
+		when(objectStore.feedObjectRecord(any(ObjectStoreRecord.class))).thenReturn("OK");
+
+		dw = new DownloadWorker(null, objectStore, Protocols.valueOf("HTTP"), "application/pdf", 60000, 60000, 0,
+				new Function<String, DownloadItem>() {
+
+					@Override
+					public DownloadItem apply(final String input) {
+						return DownloadItem.newObjectfromJSON(input);
+					}
+				});
+	}
+
+	@Test
+	public void testSSL(){
+		String url = "https://econstor.eu/bitstream/10419/45606/1/658945068.pdf";
+		dw.doDownload(1, reportMap, getDownloadItem("658945068.pdf", "658945068", url));
+
+		System.out.println("Report map status "+reportMap.getStatus());
+		assertEquals(1,reportMap.getTotalDownloaded());
+	}
+
+	private DownloadItem getDownloadItem(final String fileName, final String id, String url){
+		DownloadItem item = new DownloadItem();
+		item.setFileName(fileName);
+		item.setIdItemMetadata(id);
+		item.setOpenAccess("OPEN");
+		item.setOriginalUrl(url);
+		item.setUrl(url);
+		return item;
+	}
+}
Index: modules/dnet-download-service/trunk/src/main/java/eu/dnetlib/data/download/worker/DownloadWorker.java
===================================================================
--- modules/dnet-download-service/trunk/src/main/java/eu/dnetlib/data/download/worker/DownloadWorker.java	(revision 45026)
+++ modules/dnet-download-service/trunk/src/main/java/eu/dnetlib/data/download/worker/DownloadWorker.java	(revision 45027)
@@ -144,7 +144,7 @@
 		return report;
 	}
 
-	private void doDownload(final long threadId, final DownloadReportMap report, final DownloadItem di) {
+	public void doDownload(final long threadId, final DownloadReportMap report, final DownloadItem di) {
 		try {
 			if (getSleepTimeMs() > 0) {
 				log.debug(threadId + ": I will sleep for " + getSleepTimeMs() + " ms, as requested...");
Index: modules/dnet-download-service/trunk/src/main/java/eu/dnetlib/data/download/DownloadServiceImpl.java
===================================================================
--- modules/dnet-download-service/trunk/src/main/java/eu/dnetlib/data/download/DownloadServiceImpl.java	(revision 45026)
+++ modules/dnet-download-service/trunk/src/main/java/eu/dnetlib/data/download/DownloadServiceImpl.java	(revision 45027)
@@ -2,6 +2,7 @@
 
 import java.security.KeyManagementException;
 import java.security.NoSuchAlgorithmException;
+import java.security.Security;
 import java.security.cert.CertificateException;
 import java.util.ArrayList;
 import java.util.List;
@@ -18,6 +19,7 @@
 import eu.dnetlib.enabling.tools.blackboard.NotificationHandler;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
 import org.springframework.beans.factory.annotation.Required;
 import org.springframework.beans.factory.annotation.Value;
 
@@ -52,6 +54,8 @@
 	private NotificationHandler notificationHandler;
 	@Value("${services.download.http.sslcheck}")
 	private boolean checkCerts;
+	@Value("${services.download.https.protocols}")
+	private String httpsProtocols;
 
 	/*
 	 * (non-Javadoc)
@@ -89,7 +93,7 @@
 	@Override
 	public void start() {
 		if (!checkCerts) {
-			log.info("diabling SSL check ...");
+			log.info("disabling SSL check ...");
 			new Thread(new Runnable() {
 
 				@Override
@@ -98,6 +102,8 @@
 				}
 			}).start();
 		}
+		Security.insertProviderAt(new BouncyCastleProvider(),1);
+		System.setProperty("https.protocols", httpsProtocols);
 	}
 
 	private void disableSslVerification() {
Index: modules/dnet-download-service/trunk/src/main/resources/eu/dnetlib/data/download/applicationContext-dnet-downloadService.properties
===================================================================
--- modules/dnet-download-service/trunk/src/main/resources/eu/dnetlib/data/download/applicationContext-dnet-downloadService.properties	(revision 45026)
+++ modules/dnet-download-service/trunk/src/main/resources/eu/dnetlib/data/download/applicationContext-dnet-downloadService.properties	(revision 45027)
@@ -1 +1,2 @@
-services.download.http.sslcheck=false
\ No newline at end of file
+services.download.http.sslcheck=false
+services.download.https.protocols=TLSv1,TLSv1.1,TLSv1.2
\ No newline at end of file
Index: modules/dnet-download-service/trunk/src/main/resources/log4j.properties
===================================================================
--- modules/dnet-download-service/trunk/src/main/resources/log4j.properties	(nonexistent)
+++ modules/dnet-download-service/trunk/src/main/resources/log4j.properties	(revision 45027)
@@ -0,0 +1,13 @@
+log4j.rootLogger=WARN, CONSOLE
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
+
+org.apache.cxf.Logger=org.apache.cxf.common.logging.Log4jLogger
+
+### Application Level ###
+log4j.logger.eu.dnetlib=INFO
+log4j.logger.eu.dnetlib.data.download=DEBUG
+
+
+
Index: modules/dnet-download-service/trunk/pom.xml
===================================================================
--- modules/dnet-download-service/trunk/pom.xml	(revision 45026)
+++ modules/dnet-download-service/trunk/pom.xml	(revision 45027)
@@ -8,7 +8,7 @@
 	<modelVersion>4.0.0</modelVersion>
 	<groupId>eu.dnetlib</groupId>
 	<artifactId>dnet-download-service</artifactId>
-	<version>2.1.19-SNAPSHOT</version>
+	<version>2.2.0-SNAPSHOT</version>
 	<scm>
 	  <developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/dnet-download-service/trunk</developerConnection>
 	</scm>
@@ -27,6 +27,26 @@
 			<groupId>eu.dnetlib</groupId>
 			<artifactId>dnet-modular-objectstore-service</artifactId>
 			<version>[4.0.0,5.0.0)</version>
-		</dependency>		
+		</dependency>
+		<!-- https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on -->
+		<dependency>
+			<groupId>org.bouncycastle</groupId>
+			<artifactId>bcprov-jdk15on</artifactId>
+			<version>1.55</version>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>${junit.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.mockito</groupId>
+			<artifactId>mockito-all</artifactId>
+			<version>1.10.19</version>
+			<scope>test</scope>
+		</dependency>
+
+
 	</dependencies>
 </project>
