On 4-Oct-07, at 1:00 PM, Chris Lewis wrote:

Chris Lewis wrote:

> Any idea why I'd be getting these:
_convert_to_ssl failed (Could not create SSL socket: Socket operation on
non-socket at ./plugins/tls line 158
> [At end of _convert_to_ssl(), I'm logging $@ if it's non-null]

I've confirmed, this is only happening in qpsmtpd-async. It works fine in forkservers.

Hey Matt! ;-)

Yeah, plugins/tls wasn't written for -async... Try this patch:
...

@@ -159,6 +159,10 @@
sub _convert_to_ssl {
   my ($self) = @_;
+    if ($self->qp->isa('Qpsmtpd::PollServer')) {
+        return _convert_to_ssl_async($self);
+    }
+
    eval {
        my $tlssocket = IO::Socket::SSL->new_from_fd(
           fileno(STDIN), '+>',
@@ -178,13 +182,44 @@
...
+sub _convert_to_ssl_async {
+    my ($self) = @_;
+
+    eval {
+        my $tlssocket = IO::Socket::SSL->new_from_fd(
+            fileno($self->qp->sock), '+>',
+            SSL_use_cert => 1,
...

Is there any reason that $self->qp->sock couldn't be set to STDIN for non-async variants?

Reply via email to