[rs-commit] r42 - in /mod_csr/trunk: ChangeLog mod_csr.c

rs-commit at redwax.eu rs-commit at redwax.eu
Fri Apr 19 14:22:02 CEST 2019


Author: minfrin at redwax.eu
Date: Fri Apr 19 14:22:01 2019
New Revision: 42

Log:
Use the mime type application/pkcs7-mime for PEM encoded
responses.

Modified:
    mod_csr/trunk/ChangeLog
    mod_csr/trunk/mod_csr.c

Modified: mod_csr/trunk/ChangeLog
==============================================================================
--- mod_csr/trunk/ChangeLog	(original)
+++ mod_csr/trunk/ChangeLog	Fri Apr 19 14:22:01 2019
@@ -1,5 +1,8 @@
 
 Changes with v0.2.0
+
+ *) Use the mime type application/pkcs7-mime for PEM encoded
+    responses. [Graham Leggett]
 
  *) Add support for the expression API, and remove the obsolete
     CGI options. [Graham Leggett]

Modified: mod_csr/trunk/mod_csr.c
==============================================================================
--- mod_csr/trunk/mod_csr.c	(original)
+++ mod_csr/trunk/mod_csr.c	Fri Apr 19 14:22:01 2019
@@ -55,7 +55,6 @@
     const ap_expr_info_t *expr; /* if present, expression to be assigned to each name */
     int nid; /* name element from the request */
     int limit; /* if present, take up to the limit number of names */
-//    int index; /* the index of a potentially multivalued value, -1 for all */
 } name_rec;
 
 typedef struct
@@ -969,7 +968,7 @@
 
     /* if application/x-www-form-urlencoded, try parse the form */
     ct = apr_table_get(r->headers_in, "Accept");
-    if (ct && !strcmp("application/x-pem-file", ct)) {
+    if (ct && !strcmp("application/pkcs7-mime", ct)) {
 
         /* read in the certificates */
         if (!d2i_PKCS7(&p7, &der, len)) {
@@ -1000,7 +999,9 @@
         APR_BRIGADE_INSERT_TAIL(bb, e);
 
         /* content type */
-        ap_set_content_type(r, "application/x-pem-file");
+        ap_set_content_type(r, "application/pkcs7-mime");
+		apr_table_set(r->headers_out, "Content-Disposition",
+				"inline, filename=certificates.p7c");
         ap_set_content_length(r, len);
 
     }
@@ -1012,7 +1013,6 @@
 
         /* content type */
         ap_set_content_type(r, "application/x-x509-user-cert");
-    //    ap_set_content_type(r, "application/pkcs7-mime");
         ap_set_content_length(r, len);
 
     }



More information about the rs-commit mailing list