diff --git a/includes/push_notifications.admin.inc b/includes/push_notifications.admin.inc
index aef42da..ab1e10b 100644
--- a/includes/push_notifications.admin.inc
+++ b/includes/push_notifications.admin.inc
@@ -158,6 +158,13 @@ function push_notifications_admin_form($form_state) {
     '#default_value' => variable_get('push_notifications_apns_stream_context_limit', 5),
   );
 
+  $form['configuration_apns']['passphrase'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Passphrase'),
+    '#description' => t('If your APNS certificate has a passphrase, enter it here.'),
+    '#default_value' => variable_get('push_notifications_apns_passphrase', ''),
+  );
+
   $form['configuration_c2dm'] = array(
     '#type' => 'fieldset',
     '#title' => t('Google Push Notifications'),
@@ -232,7 +239,7 @@ function push_notifications_admin_form($form_state) {
 function push_notifications_admin_form_submit($form, &$form_state) {
   // Module settings.
   variable_set('push_notifications_require_enabled_language', $form_state['values']['push_notifications_require_enabled_language']);
-  variable_set('push_notifications_privatemsg_integration', $form_state['values']['push_notifications_privatemsg_integration']);  
+  variable_set('push_notifications_privatemsg_integration', $form_state['values']['push_notifications_privatemsg_integration']);
 
   $apns_environment = $form_state['values']['push_notifications_apns_environment'];
   switch ($apns_environment) {
@@ -260,6 +267,9 @@ function push_notifications_admin_form_submit($form, &$form_state) {
   // Set GCM API key.
   variable_set('push_notifications_gcm_api_key', $form_state['values']['push_notifications_gcm_api_key']);
 
+  // Set the APNS pem file passphrase.
+  variable_set('push_notifications_apns_passphrase', $form_state['values']['passphrase']);
+
   // Set the APNS stream limit.
   variable_set('push_notifications_apns_stream_context_limit', $form_state['values']['stream_context_limit']);
 
diff --git a/push_notifications.module b/push_notifications.module
index 1e7ec94..8cb94c5 100644
--- a/push_notifications.module
+++ b/push_notifications.module
@@ -233,7 +233,7 @@ function push_notifications_privatemsg_message_insert($message) {
       $recipients[] = $recipient->uid;
     }
 
-    push_notifications_send_message($recipients, $payload);    
+    push_notifications_send_message($recipients, $payload);
   }
 }
 
@@ -338,6 +338,13 @@ function push_notifications_open_apns() {
   // Set options on the stream context.
   stream_context_set_option($stream_context, 'ssl', 'local_cert', $apns_cert);
 
+  //If the user has a passphrase stored, we use it.
+  $passphrase = variable_get('push_notifications_apns_passphrase', '');
+  if(strlen($passphrase)) {
+    stream_context_set_option($stream_context, 'ssl', 'passphrase', $passphrase);
+  }
+
+
   // Open an Internet socket connection.
   $apns = stream_socket_client('ssl://' . PUSH_NOTIFICATIONS_APNS_HOST . ':' . PUSH_NOTIFICATIONS_APNS_PORT, $error, $error_string, 2, STREAM_CLIENT_CONNECT, $stream_context);
   if (!$apns) {
