29#ifndef PT_SSL_IOSTREAM_H
30#define PT_SSL_IOSTREAM_H
32#include <Pt/Ssl/Api.h>
33#include <Pt/Ssl/StreamBuffer.h>
34#include <Pt/NonCopyable.h>
35#include <Pt/IOStream.h>
113 , _sb(ctx, ios, mode, bufferSize)
126 { _sb.open( ctx, ios, mode); }
131 {
return _sb.currentCipher(); }
141 {
return _sb.isConnected(); }
151 {
return _sb.writeHandshake(); }
162 {
return _sb.readHandshake(); }
171 {
return _sb.shutdown(); }
176 {
return _sb.isShutdown(); }
181 {
return _sb.isClosed(); }
190 std::streamsize
import(std::streamsize maxImport = 0)
191 {
return _sb.import(maxImport); }
BasicIOStream(BasicStreamBuffer< char > *sb=0)
Definition IOStream.h:274
void setBuffer(BasicStreamBuffer< char > *sb)
Definition IOStream.h:213
NonCopyable()
Default constructor.
Definition NonCopyable.h:63
Shared configuration for SSL connections.
Definition Context.h:113
bool isShutdown() const
Returns true if a shutdown alert was received.
Definition IOStream.h:175
bool readHandshake()
Reads a handshake message from the underlying stream.
Definition IOStream.h:161
IOStream(Context &ctx, std::iostream &ios, OpenMode mode, std::size_t bufferSize=1024)
Creates an SSL stream and opens it.
Definition IOStream.h:111
void close()
Closes the stream without a TLS shutdown.
Definition IOStream.h:135
bool writeHandshake()
Writes a handshake message to the underlying stream.
Definition IOStream.h:150
IOStream(std::size_t bufferSize=1024)
Creates a closed SSL stream.
Definition IOStream.h:102
void open(Context &ctx, std::iostream &ios, OpenMode mode)
Opens the SSL stream on ios using ctx and mode.
Definition IOStream.h:125
bool isConnected() const
Returns true if the handshake has completed.
Definition IOStream.h:140
StreamBuffer & sslBuffer()
Returns the SSL stream buffer.
Definition IOStream.h:195
bool isClosed() const
Returns true if the connection was closed prematurely.
Definition IOStream.h:180
bool shutdown()
Completes or starts the TLS shutdown.
Definition IOStream.h:170
const char * currentCipher() const
Returns the cipher in use, or a placeholder if not connected.
Definition IOStream.h:130
virtual ~IOStream()
Destructor.
Definition IOStream.h:120
SSL stream buffer.
Definition StreamBuffer.h:73
OpenMode
Open mode for an SSL stream.
Definition Context.h:56
SSL/TLS streams, certificates and contexts.
Definition Client.h:50
Core module.
Definition Allocator.h:33