{"id":1670,"date":"2016-08-29T18:08:04","date_gmt":"2016-08-29T23:08:04","guid":{"rendered":"http:\/\/blografia.net\/vicm3\/?p=1670"},"modified":"2016-08-29T18:08:29","modified_gmt":"2016-08-29T23:08:29","slug":"php-y-certificados-firmados-por-uno-mismo-el-caso-de-moodle","status":"publish","type":"post","link":"https:\/\/blografia.net\/vicm3\/2016\/08\/php-y-certificados-firmados-por-uno-mismo-el-caso-de-moodle\/","title":{"rendered":"PHP y certificados firmados por uno mismo el caso de Moodle"},"content":{"rendered":"<p>Ya lo puse en gran medida en <a href=\"https:\/\/blografia.net\/vicm3\/2016\/01\/bits-of-code-php-and-self-signed-cert-on-moodle\/\">ingles en enero de este a\u00f1<\/a>o que actualizamos la mayor\u00eda de nuestros servidores a php &gt; 5.6 y empezamos a tener problemas al mandar correo desde el mismo via SSL\/TLS entonces lo documento ac\u00e1 de nuevo pero en espa\u00f1ol, <del>porque no se me ha ocurrido que escribir y para resucitar el mensaje y obtener m\u00e1s visitas<\/del> para aprovechar que me lo encontr\u00e9 ahora que migre tambi\u00e9n a Moodle 3.1 en la mayor\u00eda de mis instancias ahora que es el nuevo LTS&#8230; en su momento pens\u00e9 que era problema de Moodle pero como estaba en 2.6 ni se me ocurri\u00f3 levantar un ticket, ahora pues tampoco merece un ticket ya que es una librer\u00eda externa y m\u00e1s o menos est\u00e1 documentado:<\/p>\n<p><code>diff --git a\/lib\/phpmailer\/class.phpmailer.php b\/lib\/phpmailer\/class.phpmailer.p<br \/>\nindex fe37a93..430e47e 100644<br \/>\n--- a\/lib\/phpmailer\/class.phpmailer.php<br \/>\n+++ b\/lib\/phpmailer\/class.phpmailer.php<br \/>\n@@ -1222,7 +1222,12 @@ class PHPMailer<br \/>\n* @throws phpmailerException<br \/>\n* @return bool<br \/>\n*\/<br \/>\n- public function smtpConnect($options = array())<br \/>\n+ public function smtpConnect($options = array(<br \/>\n+ 'ssl'=&gt;array(<br \/>\n+ 'verify_peer' =&gt; false,<br \/>\n+ 'verify_peer_name' =&gt; false,<br \/>\n+ 'allow_self_signed' =&gt; true)<br \/>\n+ ))<br \/>\n{<br \/>\nif (is_null($this-&gt;smtp)) {<br \/>\n$this-&gt;smtp = $this-&gt;getSMTPInstance();<br \/>\n<\/code><\/p>\n<p>Adem\u00e1s de la entrada en ingles anterior, ac\u00e1 esta lo que utilice para descubrir que hacer<\/p>\n<p>[1]\u00a0<a href=\"http:\/\/php.net\/manual\/en\/migration56.openssl.php\">http:\/\/php.net\/manual\/en\/migration56.openssl.php<\/a><br \/>\n[2]\u00a0<a href=\"http:\/\/php.net\/manual\/en\/context.ssl.php\">http:\/\/php.net\/manual\/en\/context.ssl.php<\/a><br \/>\n[3]\u00a0<a href=\"http:\/\/serverfault.com\/questions\/660241\/postfix-tls-error\">http:\/\/serverfault.com\/questions\/660241\/postfix-tls-error<br \/>\n<\/a>[4] <a href=\"https:\/\/github.com\/PHPMailer\/PHPMailer\/wiki\/Troubleshooting\">https:\/\/github.com\/PHPMailer\/PHPMailer\/wiki\/Troubleshooting<br \/>\nY<\/a>a hay un ticket en Moodle al respecto, espero reciba m\u00e1s trafico y comentarios, si se encontraran muchos en esta necesidad pudiera ser que se a\u00f1adiera al menos una nota en config.php-dist<br \/>\n[5]\u00a0<a href=\"https:\/\/tracker.moodle.org\/browse\/MDL-55721\">https:\/\/tracker.moodle.org\/browse\/MDL-55721<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ya lo puse en gran medida en ingles en enero de este a\u00f1o que actualizamos la mayor\u00eda de nuestros servidores a php &gt; 5.6 y empezamos a tener problemas al mandar correo desde el mismo via SSL\/TLS entonces lo documento &hellip; <a href=\"https:\/\/blografia.net\/vicm3\/2016\/08\/php-y-certificados-firmados-por-uno-mismo-el-caso-de-moodle\/\">Sigue leyendo <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[9,3,10,6],"tags":[567,150,50,62,569,652,568],"class_list":["post-1670","post","type-post","status-publish","format-standard","hentry","category-educacion","category-general","category-planetalinux","category-trabajo","tag-fix","tag-git","tag-moodle","tag-php","tag-php-5-6","tag-phpmailer","tag-self-signed-cert"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":1537,"url":"https:\/\/blografia.net\/vicm3\/2016\/01\/bits-of-code-php-and-self-signed-cert-on-moodle\/","url_meta":{"origin":1670,"position":0},"title":"Bits of code, php and self signed cert on Moodle","author":"vicm3","date":"22 enero, 2016","format":false,"excerpt":"And a hack, if you happen to have a Moodle 2.6.x with phpmailer old library and you had php5.6.x you may find if you use ssl\/tls to send mail that now php is strictier with self signed certificates, well there are good documentation on php.net about [1] and [2] but\u2026","rel":"","context":"En \u00abEducaci\u00f3n\u00bb","block_context":{"text":"Educaci\u00f3n","link":"https:\/\/blografia.net\/vicm3\/category\/educacion\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2141,"url":"https:\/\/blografia.net\/vicm3\/2019\/12\/allow-wordpress-to-use-a-relay-smtp-with-self-signed-cert\/","url_meta":{"origin":1670,"position":1},"title":"Allow WordPress to use a relay smtp with self signed cert","author":"vicm3","date":"10 diciembre, 2019","format":false,"excerpt":"271 \/** 272 * Options array passed to stream_context_create when connecting via SMTP. 273 * @var array 274 *\/ 275 public $SMTPOptions = array( 276 'ssl' => array( 277 'verify_peer' => false, 278 'verify_peer_name' => false, 279 'allow_self_signed' => true 280 ) 281 ); Around line 271 on wp-includes\/class-phpmailer.php ,or\u2026","rel":"","context":"En \u00abDebraye\u00bb","block_context":{"text":"Debraye","link":"https:\/\/blografia.net\/vicm3\/category\/debraye\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2143,"url":"https:\/\/blografia.net\/vicm3\/2020\/01\/git-y-moodle\/","url_meta":{"origin":1670,"position":2},"title":"Git y Moodle","author":"vicm3","date":"7 enero, 2020","format":false,"excerpt":"Ah\u00ed por septiembre que anduve en un seminario en el IIEc y tuve la fortuna de compartir varias comidas con Gunnar, abri\u00f3 una de las gratas platicas de sobremesa con -\u00bfcual es tu flujo de trabajo habitual con git? A lo que conteste en ese entonces, \"no tengo, sigo usando\u2026","rel":"","context":"En \u00abDebraye\u00bb","block_context":{"text":"Debraye","link":"https:\/\/blografia.net\/vicm3\/category\/debraye\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2738,"url":"https:\/\/blografia.net\/vicm3\/2025\/12\/moodle-4-5-lts\/","url_meta":{"origin":1670,"position":3},"title":"Moodle 4.5 LTS","author":"vicm3","date":"5 diciembre, 2025","format":false,"excerpt":"Este a\u00f1o me propuse en verano hacer el cambio de versi\u00f3n Moodle para pasarme a la versi\u00f3n de soporte a largo plazo (Long Term Support LTS) y medio lo prepar\u00e9, fui al DC25, estuve haciendo otras cosas, sali\u00f3 Debian 13 (Trixie) y lo que pens\u00e9 que era un mont\u00f3n de\u2026","rel":"","context":"En \u00abDebian\u00bb","block_context":{"text":"Debian","link":"https:\/\/blografia.net\/vicm3\/category\/debian\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":633,"url":"https:\/\/blografia.net\/vicm3\/2009\/03\/debian-moodle-suhosin\/","url_meta":{"origin":1670,"position":4},"title":"Debian + Moodle + Suhosin","author":"vicm3","date":"13 marzo, 2009","format":false,"excerpt":"Resulta que viendo los headers de un sitio que frecuento (curl -i) me di cuenta que corren php-suhosin, el cual es una aproximaci\u00f3n similar a mod_security, pero sin los problemas de licenciamiento del mismo, de hecho ya alguien en otro momento me lo hab\u00eda sugerido cuando tuve que dejar atr\u00e1s\u2026","rel":"","context":"En \u00abSin categor\u00eda\u00bb","block_context":{"text":"Sin categor\u00eda","link":"https:\/\/blografia.net\/vicm3\/category\/sin-categoria\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1691,"url":"https:\/\/blografia.net\/vicm3\/2016\/11\/automagic-moodle-update\/","url_meta":{"origin":1670,"position":5},"title":"Automagic Moodle update","author":"vicm3","date":"14 noviembre, 2016","format":false,"excerpt":"Well its monday so semi auto magic roll of patches on CentOS via yum-cron on Debian broken for some dumb and strong firewall rules but applied via unattended updates now done through a ssh tunnel using tsocks, been thinking on create a permanent tunnel or one based on apt.conf and\u2026","rel":"","context":"En \u00abDebraye\u00bb","block_context":{"text":"Debraye","link":"https:\/\/blografia.net\/vicm3\/category\/debraye\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/blografia.net\/vicm3\/wp-json\/wp\/v2\/posts\/1670","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blografia.net\/vicm3\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blografia.net\/vicm3\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blografia.net\/vicm3\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blografia.net\/vicm3\/wp-json\/wp\/v2\/comments?post=1670"}],"version-history":[{"count":0,"href":"https:\/\/blografia.net\/vicm3\/wp-json\/wp\/v2\/posts\/1670\/revisions"}],"wp:attachment":[{"href":"https:\/\/blografia.net\/vicm3\/wp-json\/wp\/v2\/media?parent=1670"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blografia.net\/vicm3\/wp-json\/wp\/v2\/categories?post=1670"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blografia.net\/vicm3\/wp-json\/wp\/v2\/tags?post=1670"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}