Socket-Class

 view release on metacpan or  search on metacpan

xs/sc_ssl/SSL.pod  view on Meta::CPAN


B<Return Values>

Returns a true value on success or undef on failure.

=item B<set_cipher_list ( $str )>

Sets the list of available ciphers using the control string I<$str>.

B<Parameters>

=over

=item I<$str>

The cipher list consists of one or more cipher strings separated by colons.
Commas or spaces are also acceptable separators but colons are normally used.

See L<http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT>
for details.

=back

B<Return Values>

Returns a true value on success or undef on failure.

=back

=head1 XS / C API

The module provides a C interface for extension writers.

B<Example XS>

=for formatter cpp

  #include <mod_sc_ssl.h>
  
  /* global pointer to the socket class ssl interface */
  mod_sc_ssl_t *g_mod_sc_ssl;
  
  MODULE = MyModule		PACKAGE = MyModule
  
  BOOT:
  {
      SV **psv;
      psv = hv_fetch(PL_modglobal, "Socket::Class::SSL", 18, 0);
      if (psv == NULL)
          croak("Socket::Class::SSL required");
      g_mod_sc_ssl = INT2PTR(mod_sc_ssl_t *, SvIV(*psv));
  }
  
  void
  test()
  PREINIT:
      sc_t *socket;
      char *args[8];
      int r;
      SV *sv;
  PPCODE:
      args[0] = "local_port";
      args[1] = "443";
      args[2] = "listen";
      args[3] = "10";
      args[4] = "private_key";
      args[5] = "/path/to/private_key.pem";
      args[6] = "certificate";
      args[7] = "/path/to/certificate.pem";
      r = g_mod_sc_ssl->sc_create(args, 8, &socket);
      if (r != SC_OK)
          croak(g_mod_sc_ssl->sc_get_error(NULL));
      g_mod_sc_ssl->sc_create_class(socket, NULL, &sv);
      ST(0) = sv_2mortal(sv);
      XSRETURN(1);

=for formatter perl

See I<mod_sc_ssl.h> for the definition.

Use I<Socket::Class::SSL::include_path()> to get the path to I<mod_sc_ssl.h>.

=head1 SEE ALSO

The L<Socket::Class> manpage

OpenSSL, L<http://www.openssl.org/>

=head1 AUTHORS

Christian Mueller, L<http://www.alien-heads.org/>

=head1 COPYRIGHT AND LICENSE

This distribution contains multiple components, some of which fall under
different licenses. By using Socket::Class::SSL or any of the bundled
components enumerated below, you agree to be bound by the conditions of
the license foreach respective component.

=head2 Socket::Class::SSL License

The Socket::Class::SSL module is free software. You may distribute under the
terms of either the GNU General Public License or the Artistic License,
as specified in the Perl README file.

=head2 OpenSSL License

=for formatter none

 * ====================================================================
 * Copyright (c) 1998-2008 The OpenSSL Project.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer. 
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in



( run in 0.422 second using v1.01-cache-2.11-cpan-5511b514fd6 )