How to implement a ftp over tls client by qsslsocket?Connect to FTPS serverUsing psql to connect to postgresql in ssl modeCalling QSslSocket::startServerEncryption, but nothing happensMorph existing QTcpSocket to QSslSocketDoing SSL client authentication is pythonHow does FTP protocol negotiate SSL connection?QSslSocket times out when waiting for data (but QTcpSocket does not)OpenSSL: cannot retrieve LIST via FTPSFTPS client procedure for data connection
Shouldn't the "credit score" prevent Americans from going deeper and deeper into personal debt?
Start from ones
What is the best option for High availability on a data warehouse?
How to use "Du hast/ Du hattest'?
Rule based coloured background for labeling in QGIS
I got kicked out from graduate school in the past. How do I include this on my CV?
Are there any music source codes for sound chips?
Would this system work to purify water?
What is the hex versus octal timeline?
Why did this happen to Thanos's ships at the end of "Avengers: Endgame"?
Why does The Ancient One think differently about Doctor Strange in Endgame than the film Doctor Strange?
Average period of peer review process
Can't stopover at Sapporo when going from Asahikawa to Chitose airport?
Mathematical uses of string theory
Why isn't "I've" a proper response?
Attaching a piece of wood to a necklace without drilling
Science fiction short story where aliens contact a drunk about Earth's impending destruction
If the first law of thermodynamics ensures conservation of energy, why does it allow systems to lose energy?
Avoiding racist tropes in fantasy
Can pay be witheld for hours cleaning up after closing time?
How do I request a longer than normal leave of absence period for my wedding?
Which household object drew this pattern?
Non-visual Computers - thoughts?
See details of old sessions
How to implement a ftp over tls client by qsslsocket?
Connect to FTPS serverUsing psql to connect to postgresql in ssl modeCalling QSslSocket::startServerEncryption, but nothing happensMorph existing QTcpSocket to QSslSocketDoing SSL client authentication is pythonHow does FTP protocol negotiate SSL connection?QSslSocket times out when waiting for data (but QTcpSocket does not)OpenSSL: cannot retrieve LIST via FTPSFTPS client procedure for data connection
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
In FTPS, the client connect to the server, the server sending a welcome message; thus, then client send command "AUTH TLS",the server set Certificate、PrivateKey and startServerEncryption; what should the client do to finish this ssl handshake?
Server:
if ("AUTH" == command && "TLS" == commandParameters.toUpper())
auth();
void FtpControlConnection::auth()
reply("234 Initializing SSL connection.");
SslServer::setLocalCertificateAndPrivateKey(socket);
socket->startServerEncryption();
void SslServer::setLocalCertificateAndPrivateKey(QSslSocket *socket)
socket->setPrivateKey(":/ssl/server.key", QSsl::Rsa, QSsl::Pem, "1234");
Q_ASSERT(!socket->privateKey().isNull());
socket->setLocalCertificate(":/ssl/server.crt");
Q_ASSERT(!socket->localCertificate().isNull());
void SslServer::incomingConnection(PortableSocketDescriptorType socketDescriptor)
QSslSocket *socket = new QSslSocket(this);
if (socket->setSocketDescriptor(socketDescriptor))
addPendingConnection(socket);
else
delete socket;
client
socket->connectToHost(hostNameEdit->text(), portBox->value());
socket->write("AUTH TLSrn");
socket->waitForConnected();
socket->startClientEncryption();
socket->waitForEncrypted();
I wish the client finish the ssl shakehand by using startClientEncryption, and then I can use the client socket to send command or file; but it does not work; I know the client socket and the server socket already connect, but how to add ssl on this?
qt ssl ftps qsslsocket
add a comment |
In FTPS, the client connect to the server, the server sending a welcome message; thus, then client send command "AUTH TLS",the server set Certificate、PrivateKey and startServerEncryption; what should the client do to finish this ssl handshake?
Server:
if ("AUTH" == command && "TLS" == commandParameters.toUpper())
auth();
void FtpControlConnection::auth()
reply("234 Initializing SSL connection.");
SslServer::setLocalCertificateAndPrivateKey(socket);
socket->startServerEncryption();
void SslServer::setLocalCertificateAndPrivateKey(QSslSocket *socket)
socket->setPrivateKey(":/ssl/server.key", QSsl::Rsa, QSsl::Pem, "1234");
Q_ASSERT(!socket->privateKey().isNull());
socket->setLocalCertificate(":/ssl/server.crt");
Q_ASSERT(!socket->localCertificate().isNull());
void SslServer::incomingConnection(PortableSocketDescriptorType socketDescriptor)
QSslSocket *socket = new QSslSocket(this);
if (socket->setSocketDescriptor(socketDescriptor))
addPendingConnection(socket);
else
delete socket;
client
socket->connectToHost(hostNameEdit->text(), portBox->value());
socket->write("AUTH TLSrn");
socket->waitForConnected();
socket->startClientEncryption();
socket->waitForEncrypted();
I wish the client finish the ssl shakehand by using startClientEncryption, and then I can use the client socket to send command or file; but it does not work; I know the client socket and the server socket already connect, but how to add ssl on this?
qt ssl ftps qsslsocket
add a comment |
In FTPS, the client connect to the server, the server sending a welcome message; thus, then client send command "AUTH TLS",the server set Certificate、PrivateKey and startServerEncryption; what should the client do to finish this ssl handshake?
Server:
if ("AUTH" == command && "TLS" == commandParameters.toUpper())
auth();
void FtpControlConnection::auth()
reply("234 Initializing SSL connection.");
SslServer::setLocalCertificateAndPrivateKey(socket);
socket->startServerEncryption();
void SslServer::setLocalCertificateAndPrivateKey(QSslSocket *socket)
socket->setPrivateKey(":/ssl/server.key", QSsl::Rsa, QSsl::Pem, "1234");
Q_ASSERT(!socket->privateKey().isNull());
socket->setLocalCertificate(":/ssl/server.crt");
Q_ASSERT(!socket->localCertificate().isNull());
void SslServer::incomingConnection(PortableSocketDescriptorType socketDescriptor)
QSslSocket *socket = new QSslSocket(this);
if (socket->setSocketDescriptor(socketDescriptor))
addPendingConnection(socket);
else
delete socket;
client
socket->connectToHost(hostNameEdit->text(), portBox->value());
socket->write("AUTH TLSrn");
socket->waitForConnected();
socket->startClientEncryption();
socket->waitForEncrypted();
I wish the client finish the ssl shakehand by using startClientEncryption, and then I can use the client socket to send command or file; but it does not work; I know the client socket and the server socket already connect, but how to add ssl on this?
qt ssl ftps qsslsocket
In FTPS, the client connect to the server, the server sending a welcome message; thus, then client send command "AUTH TLS",the server set Certificate、PrivateKey and startServerEncryption; what should the client do to finish this ssl handshake?
Server:
if ("AUTH" == command && "TLS" == commandParameters.toUpper())
auth();
void FtpControlConnection::auth()
reply("234 Initializing SSL connection.");
SslServer::setLocalCertificateAndPrivateKey(socket);
socket->startServerEncryption();
void SslServer::setLocalCertificateAndPrivateKey(QSslSocket *socket)
socket->setPrivateKey(":/ssl/server.key", QSsl::Rsa, QSsl::Pem, "1234");
Q_ASSERT(!socket->privateKey().isNull());
socket->setLocalCertificate(":/ssl/server.crt");
Q_ASSERT(!socket->localCertificate().isNull());
void SslServer::incomingConnection(PortableSocketDescriptorType socketDescriptor)
QSslSocket *socket = new QSslSocket(this);
if (socket->setSocketDescriptor(socketDescriptor))
addPendingConnection(socket);
else
delete socket;
client
socket->connectToHost(hostNameEdit->text(), portBox->value());
socket->write("AUTH TLSrn");
socket->waitForConnected();
socket->startClientEncryption();
socket->waitForEncrypted();
I wish the client finish the ssl shakehand by using startClientEncryption, and then I can use the client socket to send command or file; but it does not work; I know the client socket and the server socket already connect, but how to add ssl on this?
qt ssl ftps qsslsocket
qt ssl ftps qsslsocket
edited Mar 27 at 18:59
eyllanesc
106k12 gold badges38 silver badges70 bronze badges
106k12 gold badges38 silver badges70 bronze badges
asked Mar 27 at 16:37
zengyhzengyh
61 bronze badge
61 bronze badge
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55382333%2fhow-to-implement-a-ftp-over-tls-client-by-qsslsocket%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55382333%2fhow-to-implement-a-ftp-over-tls-client-by-qsslsocket%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown