<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <div class="moz-cite-prefix">On 16/12/14 11:38, Øyvind Kolbu wrote:<br>
    </div>
    <blockquote cite="mid:54900B98.4060301@usit.uio.no" type="cite">
      <meta content="text/html; charset=windows-1252"
        http-equiv="Content-Type">
      <br>
      <div class="moz-cite-prefix">On 16.12.2014 10:44,
        Daniel-Constantin Mierla wrote:<br>
      </div>
      <blockquote cite="mid:548FFEEC.6020107@gmail.com" type="cite">
        <meta http-equiv="Content-Type" content="text/html;
          charset=windows-1252">
        The question would be more specific to the error message printed
        from postgres client library:<br>
        <br>
        FATAL:  no pg_hba.conf entry for host "129.240.1.1", user
        "foo_test_user", database " foo_test", SSL off<br>
      </blockquote>
      The issue here is why suddenly SSL when attempting to connect.
      When not loading the TLS module this<br>
      does not happen. I've not been able to reorder any modules in
      order for it to succeed.<br>
      <blockquote cite="mid:548FFEEC.6020107@gmail.com" type="cite"> <br>
        Is it something that is documented somewhere or maybe some web
        search can indicate the reasons why it happens?<br>
        <br>
        Can you try loading tls module before db_postgres?<br>
      </blockquote>
      One thing which works sometimes is to increase the debuglevel to 5
      and also set<br>
      memdbg=5 and memlog=5. The massive logging causes extra startup
      delay.<br>
      Maybe a TLS settings race? Non threadsafe interaction with libssl?<br>
      <br>
    </blockquote>
    TLS module initializes libssl when it is loaded. db_postgress
    creates connections at mod init, so it is later and inside same
    process (no fork at that moment).<br>
    <br>
    Based on the new details, I understand that some connections
    succeed, some not, and even sometimes all connection succeed (when
    having lot of log messages that add delay). What is the operating
    system you have? Is selinux enabled? You can try to play with
    fork_delay and modinit_delay core parameters:<br>
    <br>
    - <a class="moz-txt-link-freetext" href="http://www.kamailio.org/wiki/cookbooks/4.2.x/core#fork_delay">http://www.kamailio.org/wiki/cookbooks/4.2.x/core#fork_delay</a><br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a></pre>
  </body>
</html>