diff --git a/shared/middlewares.py b/shared/middlewares.py
index b27e95cf51d12f2cbe951ad386a69457d7f08ce7..e2ddfeaa5407d1c1e95826fca178542ee3ab5e61 100644
--- a/shared/middlewares.py
+++ b/shared/middlewares.py
@@ -2,6 +2,7 @@ import clamd
 
 from io import BytesIO
 from django.http import HttpResponseForbidden
+from django.conf import settings
 
 class ClamAVMiddleware:
     def __init__(self, get_response):
@@ -12,7 +13,11 @@ class ClamAVMiddleware:
         # Code to be executed for each request before
         # the view (and later middleware) are called.
 
-        cd = clamd.ClamdNetworkSocket()
+        cd = clamd.ClamdNetworkSocket(
+            host=settings.CLAMD_TCP_ADDR,
+            port=settings.CLAMD_TCP_SOCKET,
+            timeout=120
+        )
 
         if request.method == "POST" and len(request.FILES) > 0:
             for file_ in request.FILES.values():