diff --git a/lib/SimpleSAML/Bindings/Shib13/Artifact.php b/lib/SimpleSAML/Bindings/Shib13/Artifact.php
index 7ed7561e1082b07d528a1c48f142e030d888edb4..9d7a6d40d5d82e8088d63c616a3bd68ed2b50c1a 100644
--- a/lib/SimpleSAML/Bindings/Shib13/Artifact.php
+++ b/lib/SimpleSAML/Bindings/Shib13/Artifact.php
@@ -160,10 +160,9 @@ class SimpleSAML_Bindings_Shib13_Artifact {
 					'Content-Type: text/xml',
 			),
 		);
-		$context = stream_context_create($opts);
 
 		/* Fetch the artifact. */
-		$response = file_get_contents($url, FALSE, $context);
+		$response = SimpleSAML_Utilities::fetch($url, $opts);
 		if ($response === FALSE) {
 			throw new SimpleSAML_Error_Exception('Failed to retrieve assertion from IdP.');
 		}