Index: trunk/BNC/src/bnccredentials.cpp
===================================================================
--- trunk/BNC/src/bnccredentials.cpp	(revision 11153)
+++ trunk/BNC/src/bnccredentials.cpp	(revision 11153)
@@ -0,0 +1,341 @@
+/* -------------------------------------------------------------------------
+ * BKG NTRIP Client
+ * -------------------------------------------------------------------------
+ *
+ * Class:      bncCredentials
+ *
+ * Purpose:    Passwords from credentials files (netrc or BNC format)
+ *             instead of the configuration file
+ *
+ * Created:    31-Oct-2026
+ *
+ * Changes:
+ *
+ * -----------------------------------------------------------------------*/
+
+#include <QDateTime>
+#include <QDir>
+#include <QFile>
+#include <QFileInfo>
+#include <QMap>
+#include <QMutex>
+#include <QSet>
+
+#include "bnccredentials.h"
+#include "bnccore.h"
+#include "bncsettings.h"
+#include "bncutils.h"
+
+namespace {
+
+struct t_entry {
+  QString host;
+  int     port;     // 0: any port
+  bool    hasUser;
+  QString user;
+  QString password;
+};
+
+struct t_file {
+  t_file() : exists(false), size(-1), refused(false) {}
+  bool           exists;
+  QDateTime      modified;
+  qint64         size;
+  bool           refused;   // readable for others
+  QList<t_entry> entries;
+};
+
+QMutex                 _mutex;
+QMap<QString, t_file>  _files;
+QSet<QString>          _reported;
+
+// Log a message once per key
+void message(const QString& key, const QString& msg) {
+  if (!_reported.contains(key)) {
+    _reported.insert(key);
+    BNC_CORE->slotMessage(msg.toLatin1(), true);
+  }
+}
+
+// Split a line into tokens: white space separated, "..." quoted (with \"
+// and \\), '#' outside quotes starts a comment
+QStringList tokenize(const QString& line) {
+  QStringList tokens;
+  int ii = 0;
+  while (ii < line.size()) {
+    if (line[ii].isSpace()) {
+      ++ii;
+      continue;
+    }
+    if (line[ii] == '#') {
+      break;
+    }
+    QString token;
+    if (line[ii] == '"') {
+      for (++ii; ii < line.size() && line[ii] != '"'; ++ii) {
+        if (line[ii] == '\\' && ii + 1 < line.size()) {
+          ++ii;
+        }
+        token += line[ii];
+      }
+      ++ii; // closing quote
+    }
+    else {
+      for (; ii < line.size() && !line[ii].isSpace(); ++ii) {
+        token += line[ii];
+      }
+    }
+    tokens << token;
+  }
+  return tokens;
+}
+
+// "host" or "host:port"
+void hostAndPort(const QString& name, t_entry& entry) {
+  entry.host = name;
+  entry.port = 0;
+  int ic = name.lastIndexOf(':');
+  if (ic > 0) {
+    bool ok;
+    int port = name.mid(ic + 1).toInt(&ok);
+    if (ok && port > 0) {
+      entry.host = name.left(ic);
+      entry.port = port;
+    }
+  }
+}
+
+void parseNetrc(const QList<QStringList>& lines, t_file& file) {
+  t_entry* entry = 0;
+  bool     isDefault = false;
+  for (int iLine = 0; iLine < lines.size(); iLine++) {
+    const QStringList& tokens = lines[iLine];
+    for (int ii = 0; ii < tokens.size(); ii++) {
+      const QString& key = tokens[ii];
+      QString value = (ii + 1 < tokens.size()) ? tokens[ii + 1] : QString();
+      if (key == "machine") {
+        file.entries.append(t_entry());
+        entry = &file.entries.last();
+        entry->hasUser = false;
+        hostAndPort(value, *entry);
+        isDefault = false;
+        ++ii;
+      }
+      else if (key == "default") { // for all hosts: never used by BNC
+        entry = 0;
+        isDefault = true;
+      }
+      else if (key == "login" || key == "password" || key == "account") {
+        if (entry && !isDefault) {
+          if (key == "login") {
+            entry->hasUser = true;
+            entry->user = value;
+          }
+          else if (key == "password") {
+            entry->password = value;
+          }
+        }
+        ++ii;
+      }
+      else if (key == "macdef") { // macro definition up to an empty line
+        while (iLine + 1 < lines.size() && !lines[iLine + 1].isEmpty()) {
+          ++iLine;
+        }
+        break;
+      }
+    }
+  }
+}
+
+void parseBnc(const QString& fileName, const QList<QStringList>& lines,
+              const QList<int>& lineNumbers, t_file& file) {
+  for (int iLine = 0; iLine < lines.size(); iLine++) {
+    const QStringList& tokens = lines[iLine];
+    if (tokens.isEmpty()) {
+      continue;
+    }
+    bool ok = tokens.size() == 4;
+    t_entry entry;
+    entry.host = tokens.value(0);
+    if (tokens.value(1) == "*") {
+      entry.port = 0;
+    }
+    else {
+      bool okPort;
+      entry.port = tokens.value(1).toInt(&okPort);
+      ok = ok && okPort && entry.port > 0;
+    }
+    entry.hasUser = tokens.value(2) != "-";
+    entry.user = entry.hasUser ? tokens.value(2) : QString();
+    entry.password = tokens.value(3);
+    if (ok) {
+      file.entries.append(entry);
+    }
+    else {
+      message(fileName + QString(":%1").arg(lineNumbers[iLine]),
+              QString("Credentials file %1, line %2: not <host> <port> <user> <password>, ignored")
+              .arg(fileName).arg(lineNumbers[iLine]));
+    }
+  }
+}
+
+// Entries of a file, read again if it changed
+const t_file& readFile(const QString& fileName) {
+  t_file& file = _files[fileName];
+  QFileInfo info(fileName);
+  if (info.exists() == file.exists && (!file.exists ||
+      (info.lastModified() == file.modified && info.size() == file.size))) {
+    return file;
+  }
+  file = t_file();
+  file.exists = info.exists();
+  if (!file.exists) {
+    return file;
+  }
+  file.modified = info.lastModified();
+  file.size     = info.size();
+
+#ifndef Q_OS_WIN
+  if (info.permissions() & (QFile::ReadGroup | QFile::ReadOther)) {
+    file.refused = true;
+    message("perm:" + fileName,
+            QString("Credentials file %1 is readable for other users, not used (chmod 600)").arg(fileName));
+    return file;
+  }
+#endif
+
+  QFile inp(fileName);
+  if (!inp.open(QIODevice::ReadOnly | QIODevice::Text)) {
+    message("open:" + fileName, QString("Cannot read credentials file %1").arg(fileName));
+    return file;
+  }
+  QList<QStringList> lines;
+  QList<int>         lineNumbers;
+  int                lineNumber = 0;
+  while (!inp.atEnd()) {
+    QString line = QString::fromUtf8(inp.readLine());
+    ++lineNumber;
+    QStringList tokens = tokenize(line);
+    if (tokens.isEmpty() && line.trimmed().startsWith('#')) {
+      continue; // comment line, not the end of a netrc macro
+    }
+    lines << tokens;
+    lineNumbers << lineNumber;
+  }
+
+  // netrc, if the first token is a netrc keyword
+  QString first;
+  for (int ii = 0; ii < lines.size() && first.isEmpty(); ii++) {
+    first = lines[ii].value(0);
+  }
+  if (first == "machine" || first == "default" || first == "macdef") {
+    parseNetrc(lines, file);
+  }
+  else {
+    parseBnc(fileName, lines, lineNumbers, file);
+  }
+  return file;
+}
+
+bool sameUser(const t_entry& entry, const QString& user) {
+  return user.isEmpty() ? (!entry.hasUser || entry.user.isEmpty())
+                        : (entry.hasUser && entry.user == user);
+}
+
+}  // namespace
+
+// Credentials files: option 'credentialsFile' (comma separated), default
+// $NETRC or ~/.netrc (Windows: %HOME%\_netrc)
+////////////////////////////////////////////////////////////////////////////
+QStringList bncCredentials::fileNames() {
+  bncSettings settings;
+  QStringList names;
+  QStringList hlp = settings.value("credentialsFile").toString().split(',', Qt::SkipEmptyParts);
+  for (int ii = 0; ii < hlp.size(); ii++) {
+    QString name = hlp[ii].trimmed();
+    expandEnvVar(name);
+    if (name.startsWith("~/")) {
+      name = QDir::homePath() + name.mid(1);
+    }
+    if (!name.isEmpty()) {
+      names << name;
+    }
+  }
+  if (names.isEmpty()) {
+    QString netrc = QString::fromLocal8Bit(qgetenv("NETRC"));
+    if (netrc.isEmpty()) {
+#ifdef Q_OS_WIN
+      netrc = QDir::homePath() + "/_netrc";
+#else
+      netrc = QDir::homePath() + "/.netrc";
+#endif
+    }
+    names << netrc;
+  }
+  return names;
+}
+
+// Password of user at host:port
+////////////////////////////////////////////////////////////////////////////
+bool bncCredentials::password(const QString& host, int port, const QString& user,
+                              QString& password) {
+  QMutexLocker locker(&_mutex);
+  QStringList names = fileNames();
+  for (int iFile = 0; iFile < names.size(); iFile++) {
+    const t_file& file = readFile(names[iFile]);
+    if (file.refused) {
+      continue;
+    }
+    // exact port first, then entries for any port
+    for (int pass = 0; pass < 2; pass++) {
+      for (int ii = 0; ii < file.entries.size(); ii++) {
+        const t_entry& entry = file.entries[ii];
+        if (entry.host.compare(host, Qt::CaseInsensitive) == 0 &&
+            (pass == 0 ? (port > 0 && entry.port == port) : entry.port == 0) &&
+            sameUser(entry, user)) {
+          password = entry.password;
+          return true;
+        }
+      }
+    }
+  }
+  return false;
+}
+
+// Stream URL
+////////////////////////////////////////////////////////////////////////////
+void bncCredentials::complete(QUrl& url) {
+  if (url.userName().isEmpty()) {
+    return; // anonymous
+  }
+  QString user = QUrl::fromPercentEncoding(url.userName().toLatin1());
+  QString pass = url.password();
+  complete(url.host(), url.port(0), user, pass, false, true);
+  if (url.password().isEmpty() && !pass.isEmpty()) {
+    url.setPassword(pass, QUrl::DecodedMode);
+  }
+}
+
+// Upload or sourcetable
+////////////////////////////////////////////////////////////////////////////
+void bncCredentials::complete(const QString& host, int port, const QString& user,
+                              QString& password, bool anyUser, bool hint) {
+  QString account = (user.isEmpty() ? QString() : user + "@") + host + QString(":%1").arg(port);
+  if (!password.isEmpty()) {
+    if (hint) {
+      QMutexLocker locker(&_mutex);
+      message("config:" + account,
+              QString("%1: password in the configuration file, it can be moved to a credentials file "
+                      "(option 'credentialsFile', default ~/.netrc)").arg(account));
+    }
+    return;
+  }
+  if (user.isEmpty() && !anyUser) {
+    return;
+  }
+  if (!bncCredentials::password(host, port, user, password)) {
+    QMutexLocker locker(&_mutex);
+    message("none:" + account, QString("%1: no password in the configuration file nor in %2")
+            .arg(account).arg(fileNames().join(", ")));
+  }
+}
Index: trunk/BNC/src/bnccredentials.h
===================================================================
--- trunk/BNC/src/bnccredentials.h	(revision 11153)
+++ trunk/BNC/src/bnccredentials.h	(revision 11153)
@@ -0,0 +1,34 @@
+#ifndef BNCCREDENTIALS_H
+#define BNCCREDENTIALS_H
+
+#include <QString>
+#include <QStringList>
+#include <QUrl>
+
+// Passwords from credentials files instead of the configuration file
+// (option 'credentialsFile', default $NETRC or ~/.netrc). Two formats,
+// detected per file:
+//   netrc:  machine <host>[:<port>] login <user> password <password>
+//   BNC:    <host> <port|*> <user|-> <password>      (one entry per line)
+// Tokens are separated by white space, may be quoted ("..."), '#' starts a
+// comment. An entry for the exact port is preferred, the netrc 'default'
+// entry is never used.
+class bncCredentials {
+ public:
+  // Password of user (empty: entry without user) at host:port
+  static bool password(const QString& host, int port, const QString& user,
+                       QString& password);
+
+  // Stream URL: a user without password gets it from the credentials files;
+  // a URL without user stays anonymous
+  static void complete(QUrl& url);
+
+  // Upload or sourcetable: an empty password is taken from the credentials
+  // files (also for an empty user, e.g. Ntrip Version 1 upload if 'anyUser')
+  static void complete(const QString& host, int port, const QString& user,
+                       QString& password, bool anyUser, bool hint);
+
+  static QStringList fileNames();
+};
+
+#endif
Index: trunk/BNC/src/bncgetthread.cpp
===================================================================
--- trunk/BNC/src/bncgetthread.cpp	(revision 11148)
+++ trunk/BNC/src/bncgetthread.cpp	(revision 11153)
@@ -65,4 +65,5 @@
 #include "bncnetqueryudp.h"
 #include "bncnetqueryudp0.h"
+#include "bnccredentials.h"
 #include "bncnetquerys.h"
 #include "bncsettings.h"
@@ -95,4 +96,6 @@
   _rawFile = 0;
   _mountPoint   = mountPoint;
+  _requestUrl   = mountPoint;
+  bncCredentials::complete(_requestUrl); // password from a credentials file
   _staID        = mountPoint.path().mid(1).toLatin1();
   _format       = format;
@@ -356,5 +359,5 @@
   msleep(100); //sleep 0.1 sec
 
-  _decoder->initRinex(_staID, _mountPoint, _latitude, _longitude, _nmea,
+  _decoder->initRinex(_staID, _requestUrl, _latitude, _longitude, _nmea,
       _ntripVersion);
 
@@ -768,5 +771,5 @@
     if (_nmea == "yes") {
       if (_serialNMEA == MANUAL_NMEA) {
-        _query->startRequest(_mountPoint, _manualNMEAString);
+        _query->startRequest(_requestUrl, _manualNMEAString);
         _lastNMEA = QDateTime::currentDateTime();
       } else if (_serialNMEA == AUTO_NMEA) {
@@ -783,5 +786,5 @@
               if (i2 != -1 && data.size() > i2 + 1) {
                 QByteArray gga = data.mid(i1, i2 - i1 + 3);
-                _query->startRequest(_mountPoint, gga);
+                _query->startRequest(_requestUrl, gga);
                 _lastNMEA = QDateTime::currentDateTime();
               }
@@ -791,5 +794,5 @@
       }
     } else {
-      _query->startRequest(_mountPoint, "");
+      _query->startRequest(_requestUrl, "");
     }
 
Index: trunk/BNC/src/bncgetthread.h
===================================================================
--- trunk/BNC/src/bncgetthread.h	(revision 11148)
+++ trunk/BNC/src/bncgetthread.h	(revision 11153)
@@ -109,5 +109,6 @@
    GPSDecoder*                _decoder;
    bncNetQuery*               _query;
-   QUrl                       _mountPoint;
+   QUrl                       _mountPoint;   // as configured (identifies the stream)
+   QUrl                       _requestUrl;   // with password from a credentials file
    QByteArray                 _staID;
    QByteArray                 _format;
Index: trunk/BNC/src/bnchelp.html
===================================================================
--- trunk/BNC/src/bnchelp.html	(revision 11148)
+++ trunk/BNC/src/bnchelp.html	(revision 11153)
@@ -2692,4 +2692,27 @@
     and feed in manipulated data. The ignored errors are logged. Better save the CA certificate of the Ntrip
     Broadcaster in the 'Path to SSL certificates' directory.
+  </p>
+  <p>
+    Passwords of Ntrip Broadcasters can be kept in 'Credentials files' instead of BNC's configuration file, which
+    then contains no secrets and can be passed on. Give the user name without password in the stream's URL, e.g.
+    '//user@products.igs-ip.net:443/SSRA00BKG1', or in the upload settings (empty password). BNC takes the password
+    from the first matching entry of the credentials files. Streams without user name are retrieved without
+    authentication, even if a file contains an entry for that host. A password still given in the configuration
+    file is used as before (with a hint in the logfile), so configurations can be changed step by step.
+  </p>
+  <p>
+    Two file formats are accepted and detected from the content:
+  <ul>
+    <li>netrc, as used by curl, wget or git: 'machine products.igs-ip.net login user password secret'. The machine
+      may also be given as 'host:port' for an account that applies to one port only. The netrc 'default' entry is
+      not used.</li>
+    <li>BNC: one entry per line '&lt;host&gt; &lt;port&gt; &lt;user&gt; &lt;password&gt;', port '*' for any port,
+      user '-' for an entry without user (Ntrip Version 1 upload).</li>
+  </ul>
+    Several users per host are distinguished by the user name. An entry for the exact port is preferred over one
+    for any port. Words containing blanks are quoted: "my secret". A '#' starts a comment. Several files can be
+    given, separated by commas; default is the file named in the environment variable NETRC, otherwise ~/.netrc.
+    A file readable for other users is not used (chmod 600). Note that a password containing '%' followed by two
+    hexadecimal digits is not supported, in the configuration file neither.
   </p>
   <p><img src="IMG/Figure07.png" width=800 /></p>
Index: trunk/BNC/src/bncmain.cpp
===================================================================
--- trunk/BNC/src/bncmain.cpp	(revision 11148)
+++ trunk/BNC/src/bncmain.cpp	(revision 11153)
@@ -136,4 +136,5 @@
         "   sslClientCertPath {Full path to client SSL certificates [character string]}\n"
         "   sslIgnoreErrors   {Ignore SSL authorization errors [integer number: 0=no,2=yes]}\n"
+        "   credentialsFile   {Credentials files, netrc or BNC format, default $NETRC or ~/.netrc [character string, comma separated list]}\n"
         "\n"
         "General Panel keys:\n"
Index: trunk/BNC/src/bncsettings.cpp
===================================================================
--- trunk/BNC/src/bncsettings.cpp	(revision 11148)
+++ trunk/BNC/src/bncsettings.cpp	(revision 11153)
@@ -75,4 +75,5 @@
         setValue_p("sslClientCertPath", "");
         setValue_p("sslIgnoreErrors", "0");
+        setValue_p("credentialsFile", "");
         // General
         setValue_p("logFile", "");
Index: trunk/BNC/src/bnctabledlg.cpp
===================================================================
--- trunk/BNC/src/bnctabledlg.cpp	(revision 11148)
+++ trunk/BNC/src/bnctabledlg.cpp	(revision 11153)
@@ -47,4 +47,5 @@
 
 #include "bnctabledlg.h"
+#include "bnccredentials.h"
 #include "bncgetthread.h"
 #include "bncnetqueryv1.h"
@@ -238,5 +239,7 @@
   }
   url.setUserName(QUrl::toPercentEncoding(casterUser));
-  url.setPassword(QUrl::toPercentEncoding(casterPassword));
+  QString password = casterPassword; // empty: from a credentials file
+  bncCredentials::complete(casterHost, casterPort, casterUser, password, false, false);
+  url.setPassword(QUrl::toPercentEncoding(password));
   QByteArray outData;
   query->waitForRequestResult(url, outData);
Index: trunk/BNC/src/bncwindow.cpp
===================================================================
--- trunk/BNC/src/bncwindow.cpp	(revision 11148)
+++ trunk/BNC/src/bncwindow.cpp	(revision 11153)
@@ -194,4 +194,5 @@
   _sslIgnoreErrorsCheckBox->setCheckState(Qt::CheckState(
                                                          settings.value("sslIgnoreErrors").toInt()));
+  _credentialsFileLineEdit = new QLineEdit(settings.value("credentialsFile").toString());
 
   // General Options
@@ -828,6 +829,9 @@
   pLayout->addWidget(new QLabel("Ignore SSL authorization errors"), 5, 0);
   pLayout->addWidget(_sslIgnoreErrorsCheckBox, 5, 1, 1, 10);
-  pLayout->addWidget(new QLabel(""), 6, 1);
-  pLayout->setRowStretch(6, 999);
+  pLayout->addWidget(new QLabel("Credentials files"), 6, 0);
+  pLayout->addWidget(_credentialsFileLineEdit, 6, 1, 1, 10);
+  pLayout->addWidget(new QLabel("Default:  $NETRC or ~/.netrc"), 6, 11, 1, 20);
+  pLayout->addWidget(new QLabel(""), 7, 1);
+  pLayout->setRowStretch(7, 999);
 
   pgroup->setLayout(pLayout);
@@ -1558,4 +1562,5 @@
   _sslCaCertPathLineEdit->setWhatsThis(tr("<p>Communication with an Ntrip Broadcaster over SSL requires the exchange of server certificates. Specify the path to a directory where you save CA certificates on your system. </p><p>BNC creates from *.crt and *.pem files a CA certificate database, which is used by the socket during the handshake phase to validate the peer's certificate. </p><p>Note that SSL communication is usually done over port 443. <i>[key: sslCaCertPath]</i></p>"));
   _sslClientCertPathLineEdit->setWhatsThis(tr("<p>Two-sided communication with an Ntrip Broadcaster over SSL requires in addition the exchange of client certificates. Specify the full path to the client certificates on your system.</p><p></p><p>The file naming convention for client certificates in BNC is as follows: &lt;hostname&gt;.&lt;port&gt;.crt for the certificate and &lt;hostname&gt;.&lt;port&gt;.key for the private key, where &lt;hostname&gt; is without https://. </p><p> If available, the client or personal authentication certificate is presented to the peer during the SSL handshake process. Password protected key files are not supported. </p><p>Don't try communication via two sided SSL if you are not sure whether this is supported by the involved Ntrip Broadcaster. </p><p>Note that SSL communication is usually done over port 443. <i>[key: sslClientCertPath]</i></p>"));
+  _credentialsFileLineEdit->setWhatsThis(tr("<p>Passwords of Ntrip Broadcasters can be kept in credentials files instead of the configuration file: give the user name without password in the stream's URL (e.g. '//user@products.igs-ip.net:443/SSRA00BKG1') or in the upload settings (empty password). BNC then takes the password from the first matching entry of these files. Streams without user name are retrieved without authentication.</p><p>Two formats are accepted, detected from the file content:<br>netrc: 'machine products.igs-ip.net login user password secret', where the machine may also be given as 'host:port';<br>BNC: one entry per line '&lt;host&gt; &lt;port&gt; &lt;user&gt; &lt;password&gt;', port '*' for any port, user '-' for an entry without user (Ntrip Version 1 upload).</p><p>An entry for the exact port is preferred. Several files can be given, separated by commas; default is the file named in the environment variable NETRC or ~/.netrc. A file readable for other users is not used. A password still given in the configuration file is used as before. <i>[key: credentialsFile]</i></p>"));
   _sslIgnoreErrorsCheckBox->setWhatsThis(tr("<p>Tick 'Ignore SSL authorization errors' to accept a server certificate that cannot be verified, e.g. a self-signed certificate or one issued for another host name. The connection is then still encrypted, but the server is not authenticated: anybody able to intercept the connection may receive your user name and password and feed in manipulated data. The ignored errors are logged. Better save the CA certificate of the Ntrip Broadcaster in the 'Path to SSL certificates' directory. <i>[key: sslIgnoreErrors]</i></p>"));
 
@@ -1874,4 +1879,5 @@
   delete _sslClientCertPathLineEdit;
   delete _sslIgnoreErrorsCheckBox;
+  delete _credentialsFileLineEdit;
   delete _logFileLineEdit;
   delete _rawOutFileLineEdit;
@@ -2088,4 +2094,5 @@
   settings.setValue("sslClientCertPath", _sslClientCertPathLineEdit->text());
   settings.setValue("sslIgnoreErrors", _sslIgnoreErrorsCheckBox->checkState());
+  settings.setValue("credentialsFile", _credentialsFileLineEdit->text());
 
   QMessageBox msgBox;
@@ -2404,4 +2411,5 @@
   settings.setValue("sslClientCertPath", _sslClientCertPathLineEdit->text());
   settings.setValue("sslIgnoreErrors", _sslIgnoreErrorsCheckBox->checkState());
+  settings.setValue("credentialsFile", _credentialsFileLineEdit->text());
   // General
   settings.setValue("logFile", _logFileLineEdit->text());
Index: trunk/BNC/src/bncwindow.h
===================================================================
--- trunk/BNC/src/bncwindow.h	(revision 11148)
+++ trunk/BNC/src/bncwindow.h	(revision 11153)
@@ -141,4 +141,5 @@
     QLineEdit* _sslClientCertPathLineEdit;
     QCheckBox* _sslIgnoreErrorsCheckBox;
+    QLineEdit* _credentialsFileLineEdit;
     QLineEdit* _outFileLineEdit;
     QLineEdit* _outPortLineEdit;
Index: trunk/BNC/src/src.pri
===================================================================
--- trunk/BNC/src/src.pri	(revision 11148)
+++ trunk/BNC/src/src.pri	(revision 11153)
@@ -67,5 +67,5 @@
           bncoutf.h bncclockrinex.h bncsp3.h bncsinextro.h            \
           bncbiassinex.h                                              \
-          bncbytescounter.h bncsslconfig.h reqcdlg.h                  \
+          bncbytescounter.h bncsslconfig.h bnccredentials.h reqcdlg.h                  \
           ephemeris.h t_prn.h satObs.h                                \
           upload/bncrtnetdecoder.h upload/bncuploadcaster.h           \
@@ -110,5 +110,5 @@
           bncbiassinex.cpp                                            \
           ephemeris.cpp t_prn.cpp satObs.cpp                          \
-          bncbytescounter.cpp bncsslconfig.cpp reqcdlg.cpp            \
+          bncbytescounter.cpp bncsslconfig.cpp bnccredentials.cpp reqcdlg.cpp            \
           upload/bncrtnetdecoder.cpp upload/bncuploadcaster.cpp       \
           upload/bncrawuploadcaster.cpp                               \
Index: trunk/BNC/src/upload/bncuploadcaster.cpp
===================================================================
--- trunk/BNC/src/upload/bncuploadcaster.cpp	(revision 11148)
+++ trunk/BNC/src/upload/bncuploadcaster.cpp	(revision 11153)
@@ -22,4 +22,5 @@
 #include "bncsettings.h"
 #include "bncsslconfig.h"
+#include "bnccredentials.h"
 
 using namespace std;
@@ -46,4 +47,8 @@
   _userName = userName;
   _password = password;
+  if (!_mountpoint.isEmpty() && !_casterOutHost.isEmpty()) {
+    // empty password: from a credentials file, also without user (Ntrip Version 1)
+    bncCredentials::complete(_casterOutHost, _casterOutPort, _userName, _password, true, true);
+  }
   _outSocket = 0;
   _sOpenTrial = 0;
